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 |
|
|||
Maven Dependency |
<dependency> <groupId>org.apache.plc4x</groupId> <artifactId>plc4j-driver-eip</artifactId> <version>1.0.0</version> </dependency> |
|||
Default Transport |
|
|||
Supported Transports |
|
|||
Config options: |
||||
|
BOOLEAN |
true |
Configure if the connection should be set to transport data in Big-Endian format, or not. |
|
|
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. |
|
|
BOOLEAN |
false |
Forces the driver to use unconnected requests. |
|
|
INT |
10000 |
Default timeout for all types of requests. |
|
|
STRING |
The communication path allows for connection routing across multiple backplanes. It uses a common format found in Logix controllers. |
||
Transport config options: |
||||
tcp |
||||
|
INT |
5000 |
||
|
INT |
0 |
||
|
INT |
0 |
||
|
BOOLEAN |
true |
||
|
BOOLEAN |
false |
||
|
INT |
81920 |
||
|
INT |
81920 |
||
|
STRING |
|||
|
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 |
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.
|
| Address | Meaning |
|---|---|
|
a single element of |
|
a single element of |
|
four elements of |
|
element 3 of |
|
elements 0 to 3 of |
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.
|