EtherNet/IP

Connection String Options

Array selection uses the shared notation - a single index, an inclusive range, and optionally the array’s declared lower bound, placed before the type. See Addressing arrays.

Name

Type

Default Value

Required

Description

Name

EthernetIP

Code

eip

Maven Dependency

<dependency>
  <groupId>org.apache.plc4x</groupId>
  <artifactId>plc4j-driver-eip</artifactId>
  <version>1.0.0</version>
</dependency>

Default Transport

tcp

Supported Transports

  • tcp

Config options:

big-endian

BOOLEAN

true

Configure if the connection should be set to transport data in Big-Endian format, or not.

connection-serial-number

INT

0

Connection serial number to use in Forward_Open. CIP wants this unique per connection, so the default of 0 means 'pick a random one per connection'. Set it explicitly only when the exchange has to be reproducible, e.g. in recorded tests.
Since: 1.0.0

force-unconnected-operation

BOOLEAN

false

Forces the driver to use unconnected requests.
Since: 0.13.0

request-timeout-ms

INT

10000

Default timeout for all types of requests.

communication-path

STRING

The communication path allows for connection routing across multiple backplanes. It uses a common format found in Logix controllers.
It consists of pairs of values, each pair begins with either 1 (Backplane) or 2 (Ethernet), followed by a slot in the case of a backplane address, or if using Ethernet an ip address. e.g. [1,4,2,192.168.0.1,1,1] - Routes to the 4th slot in the first rack, which is an Ethernet module, it then connects to the address 192.168.0.1, then finds the module in slot 1.

Transport config options:

tcp

tcp.connect-timeout-ms

INT

5000

tcp.read-timeout-ms

INT

0

tcp.write-timeout-ms

INT

0

tcp.no-delay

BOOLEAN

true

tcp.keep-alive

BOOLEAN

false

tcp.send-buffer-size

INT

81920

tcp.receive-buffer-size

INT

81920

tcp.local-address

STRING

tcp.local-port

INT

0

Address Format

To read and write data to a PLC4X device, the EtherNet/IP driver uses symbolic segments. This is used to refer to objects through their symbolic names. This makes reading data a lot easier, as you do not need to specify the Datatype for reading.

{tagname}
{tagname}:{DataType}
{tagname}:{numberOfElements}
{tagname}[{startIndex}]:{DataType}:{numberOfElements}
Name Description

Tagname

symbolic name of the data. May optionally be prefixed with %.

Selection (optional)

which elements of an array to read - a single index or an inclusive range. It follows the tag name, before the data type. See Addressing arrays.

DataType (optional)

the data type of the value. Defaults to DINT when omitted, so for anything that is not a 32-bit integer it should be given explicitly - also when reading.

The selection comes before the data type, and a range says how many elements are read. Reading four DINTs starting at index 0 is myArray[0..3]:DINT.
Table 1. Examples
Address Meaning

myTag

a single element of myTag, decoded as DINT

myTag:REAL

a single element of myTag, decoded as REAL

myTag[0..3]

four elements of myTag, decoded as DINT

myArray[3]:DINT

element 3 of myArray

myArray[0..3]:DINT

elements 0 to 3 of myArray, returned as a list

A CIP array index travels in a MemberID, whose instance field is a uint 8, so a selection cannot start past index 255. A range may run beyond it - the request carries a start and a count - but it cannot begin there.

Data Types

These are the data types the driver can encode and decode:

To store Use this data type

Bit

BOOL

8-bit bit string

BYTE

16-bit bit string

WORD

32-bit bit string

DWORD

64-bit bit string

LWORD

8-bit integer

SINT

16-bit integer

INT

32-bit integer

DINT

64-bit integer

LINT

8-bit unsigned integer

USINT

16-bit unsigned integer

UINT

32-bit unsigned integer

UDINT

64-bit unsigned integer

ULINT

32-bit float

REAL

64-bit float

LREAL

Character string

STRING

The unsigned and bit string types cover their full range, so a UDINT or DWORD is returned in the range 0 to 4294967295 and a ULINT or LWORD in the range 0 to 18446744073709551615. Their signed counterparts are unchanged: a DINT of 0xFFFFFFFF still reads as -1.
Other CIP data types are accepted by the address parser but are not encoded or decoded by the driver; reading such a tag results in a response code of INTERNAL_ERROR rather than a value.