EtherNet/IP

EtherNet/IP is an industrial network protocol that adapts the Common Industrial Protocol to standard Ethernet. EtherNet/IP is one of the leading industrial protocols in the United States and is widely used in a range of industries including factory, hybrid and process.

Connection Properties

host (string, required)

The hostname or IP address of the controller

slot (integer)

The slot of the controller

Default: 0

scanRate (integer)

During normal operation, this setting specifies the time interval for scanning for tag changes at the controller (in milliseconds)

Default: 200

scanRetryDelay (integer)

On errors during scanning, this setting specifies the time interval until the next scan attempt (in milliseconds)

Default: 2000

connectionStrategy (object)

If a connection attempt fails, retries will be performed with increasing delay (waiting time) in between. The following parameters control how these delays behave.

Properties of the connectionStrategy object:

initialDelay (integer)

Delay (waiting time) of the first connection retry (in milliseconds). For subsequent retries, the delay will be increased according to the parameter incrementFactor which has a default value of 2.

Default: 1000

Additional restrictions:

  • Minimum: 1000

maxDelay (integer)

Maximum delay (waiting time) to wait until the next retry (in milliseconds). The delay (waiting time) for any subsequent connection retry will not be larger than this value. Must be strictly greater than initialDelay.

Default: 30000

incrementFactor (integer)

The factor used to increment initialDelay up to maxDelay. For example if initialDelay is set to 1000 and maxDelay to 5000 the values for the delay would be 1000, 2000, 4000, 5000.

Default: 2

Additional restrictions:

  • Minimum: 2

Endpoint Properties

tagName (string, required)

The name of the tag

Examples: "contTag", "Program:prog.progTag", "arrayTag[0]", "arrayTag[0,1,2]", "integerTag.0"

programName (string,null)

The name of the program. If this property is not set (and is null), the global program will be used.

Default: null

tagType (string, enum)

The type of the tag

This element must be one of the following enum values:

  • SINT

  • INT

  • DINT

  • REAL

  • BOOL

Input Format on Write

When writing data, a JSON object with the following structure should be sent to a write Endpoint (/set):

{
  "id": "<correlation id>",
  "value": "<value>"
}

Output Format on Write

When writing data, the result of the operation will be published to a /res topic with the following structure:

{
  "id": "<correlation id>",
  "timestamp": "<msSinceEpoch>",
  "result": "<result>"
}

Output Format on Read

When data is read from a read Endpoint (/req) the following JSON is returned as a response in a /res topic:

{
  "id": "<correlation id>",
  "timestamp": "<msSinceEpoch>",
  "value": "<value>",
}

Output Format on Subscribe

When data is read by means of a subscription Endpoint, the following JSON is returned as response:

{
  "id": "<correlation id>",
  "timestamp": "<msSinceEpoch>",
  "oldValue": "<old value>",
  "value": "<value>"
}

Sample Commissioning file:

Download: ethernetIp-example.yml

 1description: >
 2  Sample EtherNet/IP service commissioning file
 3
 4metadata:
 5  name: Sample EtherNet/IP service
 6  icon: https://www.cybus.io/wp-content/uploads/2017/10/for-whom1.svg
 7  provider: cybus
 8  homepage: https://www.cybus.io
 9  version: 1.0.0
10
11parameters:
12  host:
13    type: string
14    default: 127.0.0.1
15  initialReconnectDelay:
16    type: integer
17    default: 1000
18  maxReconnectDelay:
19    type: integer
20    default: 30000
21  factorReconnectDelay:
22    type: integer
23    default: 2
24
25resources:
26  ethernetIpConnection:
27    type: Cybus::Connection
28    properties:
29      protocol: EthernetIp
30      connection:
31        host: !ref host
32        connectionStrategy:
33          initialDelay: !ref initialReconnectDelay
34          maxDelay: !ref maxReconnectDelay
35          incrementFactor: !ref factorReconnectDelay
36
37  sampleSubscription:
38    type: Cybus::Endpoint
39    properties:
40      protocol: EthernetIp
41      connection: !ref ethernetIpConnection
42      subscribe:
43        tagName: dn_count
44        programName: SimulationMain
45
46  sampleRead:
47    type: Cybus::Endpoint
48    properties:
49      protocol: EthernetIp
50      connection: !ref ethernetIpConnection
51      subscribe:
52        tagName: dn_count
53        programName: SimulationMain
54
55  sampleWrite:
56    type: Cybus::Endpoint
57    properties:
58      protocol: EthernetIp
59      connection: !ref ethernetIpConnection
60      subscribe:
61        tagName: dn_count
62        programName: SimulationMain
63        tagType: DINT