Exchanging Data Using Explicit Messages

The Guidance Controller EtherNet/IP server supports remote client (PLC or PAC) requests to read or write data in various formats. The remote client reads data from the Guidance Controller by using CIP Data Table Read requests (service code &H4C) and sends data to the Guidance Controller by using CIP Data Table Write requests (service code &H4D). The GPL EtherNet/IP server receives these requests in “explicit” message packets.

The Guidance Controller allows up to 4 different clients to make explicit connections. At most 8 connections are allowed at any one time.

 

Guidance Controller Configuration

Before configuring or attempting to connect a remote client, you should first configure the Guidance Controller. This configuration is accomplished by setting the "EtherNet/IP Data map" (DataID 593) strings.

Parameter Database ID Parameter Name Description

593

EtherNet/IP Data map: type, index, dir, length

An array of up to 8 strings allowing configuration of up to 8 data mappings.

Each string contains 4 comma-delimited fields.

"type, index, dir, length"

where

type

This is a keyword that describes the type of the data that is to be exchanged. The possible types are defined in the following table.

Keyword

 Hex Code

Description

 SINT

C2

  Signed 8-bit integer

 INT

C3

  Signed 16-bit integer

 DINT

C4

  Signed 32-bit integer

 USINT

C6

  Unsigned 8-bit integer

 UINT

C7

  Unsigned 16-bit integer

 UDINT

C8

  Unsigned 32-bit integer

 REAL

CA

  32-bit IEEE floating point

 LREAL

CB

  64-bit IEEE floating point

 STRING

A0

  String up to 84 bytes in length

The "Keywords" must be entered into the configuration strings. The hex code values are returned in response to any client read requests. Not all clients support all these data types. The most common types are SINT, INT, DINT, REAL, and STRING.

index

This is the register index value, from 1 to 8, that specifies which of 8 possible groups of values are read or written. Within GPL, the values are stored within one of two possible Parameter Database elements, DataID 594 “EtherNet/IP numeric register” for numeric values and DataID 595 “EtherNet/IP string register “ for string values. The index determines the Unit number when accessing these database elements. On the PLC or PAC, the index determines the name of the data tag used to read or write a group of values from a remote client. The PLC or PAC data tag name is "REGISTER_n" where n is one of these index values, from 1 to 8.

dir

This is a keyword indicating the direction of data transfer:

       T2O for target to origin, or
       O2T for origin to target.

The Guidance Controller is the target, and the remote PLC is the origin, so T2O transmits GPL output signals to a PLC, and O2T receives digital input signals from a PLC.

length

For numeric values, length is the number maximum number of array elements that can be transmitted as a group during a single transaction. The maximum value for length is determined by the size of the data type. The overall size (length * data size) must not exceed 512 bytes. For string values, this value is the length of the string (number of bytes in the string), and cannot be greater than 84 bytes.

Once the Guidance Controller is configured, enable the server operation by setting database parameter 590 (EtherNet/IP Enable) to 1, which causes the server to begin responding to client requests.

Remote Client Configuration

The detailed instructions for configuring a remote client (PLC or PAC) will vary depending on the particular client being used, but the general steps are as follows:

  1. Select a Generic Ethernet Device and specify the IP address of the Guidance Controller.
  2. To read from the Guidance Controller, specify CIP Data Table Read, which corresponds to service code 4C (hex). To write to the Guidance Controller, specify CIP Data Table Write, which corresponds to service code 4D (hex).
  3. Enter a symbol tag name "REGISTER_n," where n is a single digit 1 through 8 equal to the index in the applicable "EtherNet/IP Data map" (DataID 593) configuration specification. If you selected CIP Data Table Read in the previous step, this entry must have direction T2O. If you selected CIP Data Table Write in the previous step, this entry must have direction O2T.
  4. Select the data type that is equivalent to the type keyword in the applicable "EtherNet/IP Data map" (DataID 593) configuration specification.
  5. If the data type is STRING, set the number of elements to be transferred to 1.
  6. If the data type is any numeric value (non-STRING) and all of the elements of the GPL array are to be exchanged, set the number of elements to be transferred equal to the array length and set a starting array index of 0.  If only some of the array elements are to be transferred, set the number of array elements to exchange and the index for the first array element to be accessed.  A index value of 0 means transfer starting at the first element, 1 means transfer starting at the second element, etc.
  7. If your client supports it and you plan to read or write the data often, select cache connection. This selection keeps the TCP connection open so that time is not spent reestablishing the connection during each subsequent transaction.

 

Accessing Explicit Data from GPL

Once an explicit message connection has been configured, a GPL procedure or web page can utilize the Parameter Database to set or read the values of the data being transferred. Two new parameters provide access to these values as shown in the table below. The number and types of data available in these parameters is determined by the values of the "EtherNet/IP Data map" (DataID 593) configuration strings.

Parameter Database ID Parameter Name Description

594

EtherNet/IP numeric register

Contains up to 8 arrays (accessed by setting the unit from 1 to 8) of numeric data that are read or written by a remote EtherNet/IP client. The unit number for these arrays matches the index field of the corresponding “EtherNet/IP Data map” (DataID 593). The type field of the data map determines the data type of these numeric values. The number of elements in the arrays (from 1 to 512) is determined by the length field in the data map.

595

EtherNet/IP string register

Contains up to 8 strings (accessed by setting the unit from 1 to 8) that are read or written by a remote EtherNet/IP client. The unit number for these arrays matches the index field of the corresponding “EtherNet/IP Data map” (DataID 593). The data map type field always specifies STRING. The length of each string is determined by the length field in the data map.

When you change the "EtherNet/IP Data map" (DataID 593) communication specification, the data available in DataID 594 and 595 dynamically changes.

If a data map specifies the direction at "O2T," the value is written by the remote client and cannot be written by the local GPL system.

Digital I/O Configuration Example

Consider the following sample data map definition:

593, 1, 1, 0, "EtherNet/IP Data map: type, index, dir, length" =
"DINT, 1, O2T, 16",
"REAL, 2, T2O, 8",
"STRING, 3, O2T, 64",
"STRING, 4, T2O, 32"

The 1st configuration string specifies that an array of 16, 32-bit signed integers can be transferred from the PLC to the Guidance Controller and will be available via index #1. These values are written by the remote client to tag "REGISTER_1" with data type "DINT". These data values may be read in GPL using the Controller.PdbNum method. For example, the 3rd array value is read by:

value = Controller.PdbNum (594, 1, , 3)

The 2nd configuration string specifies that an array of 8, 32-bit floating point values can be transferred from the Guidance Controller to the PLC and will be available via index #2. These values are read by the remote client from tag "REGISTER_2" with data type "REAL". These data values may be read or written in GPL using the Controller.PdbNum method. For example, the 8th element of this array is written by:

Controller.PdbNum (594, 2, , 8) = value

The 3rd configuration string specifies that a string with a maximum length of 64 characters can be transferred from the PLC to the Guidance Controller and will be available via index #3. This value can be written by the remote client using tag "REGISTER_3" with data type "STRING". The string value may be read in GPL using the Controller.Pdb method. Note that DataID 595 is used to access the string value, rather then DataID 594. For example, the strings value may be read by:

str = Controller.Pdb (595, 3)

The last configuration string specifies that a string with a maximum length of 32 characters can be transferred from the Guidance Controller to the PLC and will be available via index #4. This value can be read by the remote client using tag "REGISTER_4" with data type "STRING". The string value may be written or read in GPL using the Controller.Pdb method. Note that DataID 595 is used to access the string value, rather then DataID 594. For example, the value of the string may be written by:

Controller.Pdb (595, 4) = "My string value"