Allen-Bradley: Write Node

The Allen-Bradley: Write Node allows you to write to multiple tags on your Allen-Bradley CompactLogix or ControlLogix programmable logic controller (PLC) through EtherNet/IP. This node is only available in Edge Workflows.

Allen-Bradley Write Node

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 the MAX_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.

Write Instructions

You may define multiple write instructions for the Allen-Bradley: Write 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: (Required) A string template defining the tag to write a value to.
  • Program: (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 write instructions via a payload path the only valid data types are ‘atomic’ or ‘string’.

  • Value: (Required) A string template of the value to write to the tag.

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
  • value

Note: The option to define instructions as a payload path is only available in GEA version 1.19.2 or higher.

Result

The success or failure of each write instruction will be placed in an object at the Destination Path - a payload path (optional) under the write key. If the write is successful the write value will be success, and conversely if the write failed the write value will be fail.

If the write failed there will be a list of errors at the Destination Path under the key errors. Because the tags are written as a group one failed write for a tag may cause the other writes in the group to fail.

Along with the write and possible errors, each write 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 write, where the Destination Path is destination.allenWrite:

{
  "destination": {
    "allenWrite": {
      "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"
      },
      "write": "success"
    }
  }
}

The following is an example of a failure to write:

{
  "destination": {
    "allenWrite": {
      "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"
      },
      "write": "fail",
      "errors": [
        {
          "type": "ALLEN-BRADLEY_WRITE_ERROR",
          "message": "Something useful to help you fix the issue."
        }
      ]
    }
  }
}

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.