These docs are for v7.2.0. Click to read the latest docs for v7.6.0.

Ethernet/IP Driver for AllenBradley

This driver allows to interact with AllenBradley PLCs using the EthernetIP protocol.

Supported PLCs

The driver is compatible with the AllenBradley PLCs that implement the "Logix 5000 Controllers Data Access" Ethernet/IP services described in the following document, the document also mentions some of the supported PLCs:

Supported features

  • Read tag and write tag requests.
  • Decoding/encoding of the following data types:
    • BOOL
    • SINT
    • INT
    • DINT
    • REAL
    • BITS
    • STRING (82 bytes string)
  • Decoding/encoding arrays of the atomic types above using the JSON format.
  • Reading any data type as raw byte array data.

Limitations

  • Multi dimensional array types are supported only in raw mode.
  • Decoding/encoding of entire structured data types using the JSON format is not supported (except for the 82 bytes string). It is possible to retrieve atomic fields contained in structured data.
  • Reading/writing custom string types (string types that are not the default 82 byte string) using the STRING value.type is not supported. A possible workaround is reading/writing the LEN and DATA fields separately and implementing conversions to the String Wires type using a Javascript filter.
  • Listen mode is not supported by the AllenBradley services.

Driver configuration

The driver provides the following global (instance) configuration options:

  • Host: The hostname or ip address of the PLC.
  • Slot: The slot number (0, 1, ..) of the controller within PLC crate.
  • Timeout: The connection timeout in milliseconds.

Channel configuration

The driver provides the following channel configuration parameters:

  • Tag: The tag to read or write. The tag can refer to array items or structure fields with the following notation:

    • Array access: <path to an array data type>[array index], example myArray[1]
    • Struct field access: <path to a structured data type>.<field name> example myStruct.myField

    The array and field access syntax can be combined. For example the following tags are valid:

    • myStructArray[5].myField
    • dataPoint.items[4].nested[3].field

    Tag name is case sensitive, channels whose Tag parameters differ only in character case will refer to different tags on the PLC.

  • Array length: Enables reading an array or a portion of an array using the JSON format. In this case specifies the number of items to read. If this parameter is specified, Tag must refer to an array data point. This parameter must be left empty for channels that refer to atomic types.

  • Array offset: This parameter specifies an offset inside the array addressed by Tag to start reading/writing to/from. This parameter is useful if Array length is specified as well. This parameter must be left empty for channels that refer to atomic types.

Listen mode is not supported by the driver. Using the Driver.registerChannelListener() API will fail. Ticking the listen flag on AB Asset channels will have no effect.

Data representation

Atomic types

The following atomic types can be read and written selecting the Wires/Driver numeric and boolean types as value.type:

  • BOOL: BOOLEAN and numeric types (zero/non-zero conversion is performed)
  • SINT: numeric types
  • DINT: numeric types
  • INT: numeric types
  • REAL: numeric types
  • BITS: numeric types (value is encoded as a 32 bit integer)

Strings must be read/written using the JSON format.

JSON

If STRING is used as value.type, the driver will return (reads) and require (writes) data encoded in JSON. The format used in the two cases is slightly different.

Reads

The returned value is a JSON object with the following two properties:

  • value: Represents the read value. Can be a of different JSON types:

    • boolean: BOOL
    • number: SINT, DINT, INT, REAL, BITS
    • string: STRING
    • array: An array of the supported atomic types, represented as JSON booleans, numbers or strings as described above
  • type: Reports the PLC data type, the allowed values are the following:

    • BOOL
    • SINT
    • DINT
    • INT
    • REAL
    • BITS
    • STRUCT (for the string case)

    If the value is an array, a [] suffix will be added.

Examples:

{
  "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  "type": "SINT[]"
}
{
  "value": 0,
  "type": "BITS"
}
{
  "value": "foo",
  "type": "STRUCT"
}

Writes

For writes using the JSON format, the user must provide a JSON object with a single field:

  • value: Encoded using the same rules as the value field for reads

Examples:

{
  "value": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}
{
  "value": 0
}
{
  "value": "foo"
}

Raw requests

If BYTE_ARRAY is used as value.type, the driver will perform a raw request returning the data as encoded by the wire protocol. This request kind supports any data type.
The returned data will contain a type identification tag followed by the actual data.
Structure encoding contains the binary representation of the fields encoded in sequence, possibly interleaved by padding bytes.
See https://literature.rockwellautomation.com/idc/groups/literature/documents/pm/1756-pm020_-en-p.pdf for more information about value decoding.
This mode only supports transferring data types that fit in a single frame payload, the payload size is reported to be "approximately 500 bytes" by AB documentation.

This mode is only supported for reads.