Allen-Bradley: Read Node
The Allen-Bradley: Read Node allows you to read multiple tags from your Allen-Bradley CompactLogix or ControlLogix programmable logic controller (PLC) through EtherNet/IP. This node is only available in Edge Workflows.
Configuration
There are three main parts of the configuration for this node …
Address Configuration
Address Configuration contains three fields:
- Host: (Required) A string template for the IP address at which the PLC or EtherNet/IP Module resides.
- Slot: (Required) A string template or integer for the PLC Slot number.
- Keep-Alive Interval: (Optional) A string template or integer for the seconds between keep-alive connection requests. Set this value lower than your device’s connection timeout. Blank (the default) or 0 turns off the keep-alive request.
-
Timeout Template: (Optional) The length of time, in milliseconds, to wait for a response before timing out the request. Default is
30000
(30 seconds), or the value of theMAX_EXTERNAL_CALL_TIME
environment variable, if set.- Note: This option is only available in GEA version 1.54.0 or higher. Prior versions use the default as described above.
Read Instructions
You may define multiple read instructions for the Allen-Bradley: Read Node, and you must define at least one. Instructions may be defined individually as string templates, or as a payload path pointing to an array of instruction objects.
When defining instructions individually, each instruction has the following fields:
- Controller or Program Tag Template: (Required) A string template defining the tag to read.
- Program Template: (Optional) A string template for the program which your program tag is a member of. In case of a controller tag (above) leave this blank.
-
Data Type: Atomic (SINT, INT, DINT, REAL, BOOL) or STRING. When giving read instructions via a payload path the only valid data types are ‘atomic’ or ‘string’.
- Note: This option is removed and has no effect in GEA version 1.54.0 or higher.
-
Length Template: If reading a tag array, provide the number of items to read. Defaults to the first item if not provided. If a value greater than 1 is provided and the tag being read is not an array, the read instruction will fail.
- Note: This option is only available in GEA version 1.54.0 or higher. In prior versions, the operation will only return the first item when reading an array.
- Result Key: (Required) The key at which to store the result of this read operation. This key will exist on the Result Path defined below the instructions. This can be any string except
errors
orplcProperties
, since these keys are reserved additional output.
When defining instructions as a payload path, the path should point to an array of objects on your payload, with each object having the following keys (corresponding to the fields described above) …
tag
program
type
length
key
Note: The option to define instructions as a payload path is only available in GEA version 1.19.2 or higher.
Result
The results of each read instruction will be placed in an object at the Destination Path
(a payload path) at each instruction’s Result Key
. It is important that each key is named uniquely so the node does not overwrite another read result.
If the key is not present in the Destination Path of the payload, it means the read failed, and there will be a list of errors at the Destination Path under the key errors
. For this reason, this node restricts Result Keys to not resolve to the path errors
. Because the tags are read as a group, one failed read for a tag may cause the other keys in the group not to appear.
Along with the Result Key
and possible errors
, each read object at the Destination Path
will include a plcProperties
object key. The PLC Properties object includes current device information about various possible faults, status, version, time, slot, serial number, and name.
Node Example
The following is an example of a successful read, where an instruction’s Result Key is myProgramDint
, and the Destination Path is destination.allenStart
:
{
"destination": {
"allenStart": {
"plcProperties": {
"io_faulted": false,
"majorUnrecoverableFault": false,
"majorRecoverableFault": false,
"minorUnrecoverableFault": false,
"minorRecoverableFault": false,
"faulted": false,
"status": 12640,
"version": "31.11",
"time": null,
"slot": 0,
"serial_number": 1622838845,
"name": "1769-L16ER/B LOGIX5316ER"
},
"myProgramDint": 42
}
}
}
The following is an example of a failure to read, where a resultKey should have been myProgramDint
, and the destination path is destination.allenStart
:
{
"destination": {
"allenStart": {
"plcProperties": {
"io_faulted": false,
"majorUnrecoverableFault": false,
"majorRecoverableFault": false,
"minorUnrecoverableFault": false,
"minorRecoverableFault": true,
"faulted": true,
"status": 12640,
"version": "31.11",
"time": null,
"slot": 0,
"serial_number": 1622838845,
"name": "1769-L16ER/B LOGIX5316ER"
},
"errors": [
{
"type": "ALLEN-BRADLEY_READ_ERROR",
"message": "Something useful to help you fix the issue."
}
]
}
}
}
Related Nodes
Was this page helpful?
Still looking for help? You can also search the Losant Forums or submit your question there.