Get_Attribute_Single: Get an Attribute of an Object

Function Block Description

This function block returns the content of a specific attribute of an object instance.

To use the function block, you must add a at least one EtherNet/IP device under the protocol manager. Refer to Add a Device.

Graphical Representation

Inputs

This table describes the input variables:

Input

Data type

Comment

i_xExecute

BOOL

Value range: FALSE, TRUE.

Default value: FALSE.

A rising edge of the input Execute starts the function block. The function block continues execution and the output Busy is set to TRUE. Another rising edge of the Execute input while the function block is executing is ignored.

  • FALSE: If the input Execute is set to FALSE during the execution of the function block, the output Done or Error is set to TRUE for one cycle.

  • TRUE: The output Done or Error is set to TRUE as long as the input Execute is set to TRUE.

i_xAbort

BOOL

Value range: FALSE, TRUE.

Default value: FALSE.

  • FALSE: Execution has not been aborted.

  • TRUE: Execution has been aborted by another function block.

i_xMsgType

BOOL

  • FALSE: UCCM

  • TRUE: Connected (Class 3) message

i_adTargetIP

TCP_ADDR

IP address of target.

i_dwClass

DWORD

Target class.

Refer to How To Find Object Information in Device Documentation.

It must be 0xFFFFFFFF if the class is not part of the request.

i_dwInstance

DWORD

Target instance.

Refer to How To Find Object Information in Device Documentation.

It can be 0 if the target is class instance. It must be 0xFFFFFFFF if the instance is not part of the request.

i_dwAttribute

DWORD

Target attribute.

Refer to How To Find Object Information in Device Documentation.

It must be 0xFFFFFFFF if the attribute is not part of the request.

Outputs

This table describes the output variables:

Output

Data type

Comment

q_xDone

BOOL

Value range: FALSE, TRUE.

Default value: FALSE.

  • FALSE: Execution has not been started, or an error has been detected.

  • TRUE: Execution terminated without an error detected.

q_xBusy

BOOL

Value range: FALSE, TRUE.

Default value: FALSE.

  • FALSE: Function block is not being executed.

  • TRUE: Function block is being executed.

q_xAborted

BOOL

Value range: FALSE, TRUE.

Default value: FALSE.

  • FALSE: Execution has not been aborted.

  • TRUE: Execution has been aborted by Abort input.

q_xError

BOOL

Value range: FALSE, TRUE.

Default value: FALSE.

  • FALSE: Execution of the function block is running, no error has been detected.

  • TRUE: An error has been detected in the execution of the function block.

q_byCommError

BYTE

Gives information about the detected error. Refer to CommunicationErrorCodes: Communication Error Codes.

q_dwOperError

DWORD

Gives information about the detected error. Refer to OperationErrorCodes: Operation Error Codes.

q_abyResponseData

ARRAY OF BYTE

0…MAX_EIP_REQUEST_DATA_SIZE

Response data in case of a success.

q_wDataSize

WORD

The size of the response data in bytes.