Configuring the Address Parameter

To configure the Address parameter, use the ADDM function to convert the character string, described below, to an address that is input into the ADR parameter of the DATA_EXCH block:

ADDM(‘rack.slot.channel{ip_address}message_type.protocol’), where:

This field...

Represents...

rack

the number assigned to the rack containing the communication module

slot

the position of the communication module in the rack

channel

the communication channel—set to a value of 0

ip_address

the IP address of the remote device, for example 193.168.1.6

message_type

the type of message, presented as a three character string—either:

  • UNC (indicating an unconnected message), or

  • CON (indicating a connected message)

protocol

the protocol type—the three character string CIP

Configuring the Data_to_Send Parameter

The Data_to_Send parameter varies in size. It consists of contiguous registers that include—in sequence—both the message type and the CIP request:

Offset (words)

Length (bytes)

Data Type

Description

0

2 bytes

Bytes

Message type:

  • High byte = size of the request in words

  • Low byte = EtherNet/IP service code

1

Management_Param[3] (size of Data_to_Send) minus 2

Bytes

The CIP request1.

NOTE: The structure and size of the CIP request depends on the EtherNet/IP service.

1 Structure the CIP request in little endian order.

Contents of the Received_Data Parameter

The Received_Data parameter contains only the CIP response. The length of the CIP response varies, and is reported by Management_Param[3] after the response is received. The format of the CIP response is described, below:

Offset (words)

Length (bytes)

Data Type

Description

0

2

Byte

  • High byte (MSB) = reserved

  • Low byte (LSB): reply service

1

2

Byte

2

length of additional status

Byte array

Additional Status1

...

Management_Param[3] (size of Received_Data) minus 4, and minus the additional status length

Byte array

Response data

1. Refer to The CIP Networks Library, Volume 1, Common Industrial Protocol at section 3-5.6 Connection Manager Object Instance Error Codes.

NOTE: The response is structured in little endian order.

Checking the Received_Data Response for System and CIP Status

Use the contents of the Received_Data parameter to check both the system status and the CIP status of the Ethernet communication module when handling the explicit message.

First:

Check the value of the high byte (MSB) of the first response word, positioned at offset 0. If the value of this byte is:

  • equal to 0: the system properly handled the explicit message

  • not equal to 0: a system-based event occurred

    Refer to the list of EtherNet/IP Explicit Messaging Event Codes for an explanation of the system-based event code contained in the second response word, positioned at offset 1.

Next:

If the system properly handled the explicit message, and the high byte of the first response word equals 0, check the value of the second response word, positioned at offset 1. If the value of this word is:

  • equal to 0: the explicit message was properly handled by the CIP protocol

  • not equal to 0: a CIP protocol-based event occurred

    Refer to your CIP documentation for an explanation of the CIP status displayed in this word.