EipDataExch: Send an Explicit Message

Function Block Description

This function block sends an explicit message.

The time to perform the operation is configurable from the protocol manager.

There is a timeout value for connected messages and a timeout value for unconnected messages.

This generic function block may be used for features not implemented in the EtherNet/IP Explicit messaging Library.

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

IL and ST Representation

To see the general representation in IL or ST language, refer to Function and Function Block Representation.

I/O Variable Description

This table describes the input variables:

Input

Type

Inherited from

Comment

i_xExecute

BOOL

BASE

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

BASE

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_byService

BYTE

-

Service to be performed (service code see above)

i_dwClass

DWORD

-

Target class.

Refer to How To Find Object Information in Device Documentation.

Must be 0xFFFFFFFF if the class should not be a part of request

i_dwInstance

DWORD

-

Target instance.

Refer to How To Find Object Information in Device Documentation.

Can be 0 if the target is class instance. Must be 0xFFFFFFFF if the instance should not be a part of request

i_dwAttribute

DWORD

-

Target attribute.

Refer to How To Find Object Information in Device Documentation.

Must be 0xFFFFFFFF if the attribute should not be a part of request

i_dwMember

DWORD

-

Target member.

Refer to How To Find Object Information in Device Documentation.

Must be 0xFFFFFFFF if the member should not be a part of request

i_abyRequestTag

ARRAY OF [0…250] BYTE

-

Target extended symbol segment. If not used i_wTagSize must be 0

i_wTagSize

WORD

-

The actual size of the i_abyRequestTag

i_abyRequestData

ARRAY OF [0…999] BYTE

-

Data that should be sent to the target. If not used i_wDataSize must be 0

i_wDataSize

WORD

-

The actual size of the i_abyRequestData

This table describes the output variables:

Output

Type

Inherited from

Comment

q_xDone

BOOL

BASE

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

BASE

Default value: FALSE.

  • FALSE: Function block is not being executed.

  • TRUE: Function block is being executed.

q_xAborted

BOOL

BASE

Default value: FALSE.

  • FALSE: Execution has not been aborted.

  • TRUE: Execution has been aborted by Abort input.

q_xError

BOOL

BASE

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

CommunicationErrorCodes

BASE

Communication error code

q_dwOperError

OperationErrorCodes

BASE

Operation error code

q_abyResponseData

ARRAY OF [0…999] BYTE

-

Response Data in case of a success

q_wDataSize

WORD

-

The size of the response Data in bytes

q_abyExtStatus

ARRAY OF [0…499] BYTE

-

Extended Status Data in case of an error response

q_wExtStatusSize

WORD

-

The size of the Extended Status Data in 16-bit words

q_wExtStatus

WORD

-

Extended status word

Example

This is an example of a call of this function:

MyEipDataExch(

i_xExecute:= Execute,

i_xAbort:= Abort,

q_xDone=> Done,

q_xBusy=> Busy,

q_xAborted=> Aborted,

q_xError=> Err,

q_byCommError=> CommError,

q_dwOperError=> OperError,

i_adTargetIp:= IpAddr,

i_xMsgType:= MsgType,

i_byService:= Service,

i_dwClass:= Class,

i_dwInstance:= Instance,

i_dwAttribute:= Attribute,

i_dwMember:= Member,

i_abyRequestTag:= RequestTag,

i_wTagSize:= TagSize,

i_abyRequestData:= RequestData,

i_wDataSize:= ReqDataSize,

q_abyResponseData=> ResponseData,

q_wDataSize=> ResDataSize,

q_abyExtStatus=> ExtStatusArray,

q_wExtStatusSize=> ExtStatusSize,

q_wExtStatus => ExtStatus);