The Allen-Bradley Device Plugin allows reading and writing values from Allen-Bradley PLC devices over EtherNet/IP.
The following device types are supported:
The whole Allen-Bradley Device Plugin configuration is located in the node path /System/Devices/Allen-Bradley Device
.
An Allen-Bradley Device Channel represents the connection to a Allen-Bradley PLC.
IP address of the Allen-Bradley PLC.
The device type of the Allen-Bradley PLC. The following device types are supported:
The CIP path to the PLC. This field must be specified for ControlLogix/CompactLogix as well as for a DH+ protocol bridge (i.e. a DHRIO module).
This field can have the format A,B
where A
specifies the port type (1=Backplane) and B
specifies the slot in which the CPU is plugged.
Example: 1,0
The timeout which shall be applied for read and write operations.
To add a new Allen-Bradley Channel, please follow these steps:
Allen-Bradley Device/Channels
, or right-click on the Allen-Bradley Device/Channels
node and select Add Channel
.Add Channel
dialog, specify the settings for the Allen-Bradley connection.
Within the node Variables
you can create datapoint nodes which can be read and written from/to the Allen-Bradley PLC as tags.
The Value Type
property must be set to the corresponding tag type. Currently the following tag types are supported:
Tag Type | CoDaBix Type |
---|---|
SINT | SByte or SByte-Array |
USINT | Byte or Byte-Array |
INT | Int16 or Int16-Array |
UINT | UInt16 or UInt16-Array |
DINT | Int32 or Int32-Array |
UDINT | UInt32 or UInt32-Array |
LINT | Int64 or Int64-Array |
ULINT | UInt64 or UInt64-Array |
REAL | Single or Single-Array |
STRING (or user-defined String data type) | String or String-Array |
For String data types, an ASCII/ISO-8859-1-like encoding is assumed (the high byte of the 16-bit char will be cut off). While this can mean that surrogate pairs (for characters outside of the Unicode BMP) are not correctly handled, it will mean that the number of bytes is the same as the string length.
Note: Each signed/unsigned pendant of a datatype can also be used in place of the datatype. For example, SINT
can also be used as Byte
instead of SByte
, but the MSB (most significant bit) will have a different interpretation, as is interpreted as sign bit for signed data types.
The Path
property of the node is used to specify the tag name, optionally a type specification, and (for arrays) optionally the offset and the length of the data:
<TagName> <TagName>, <Length> <TagName>, <Type> <TagName>, <Type>[<Length>]
Placeholder | Description |
---|---|
<TagName> | The full name of the tag. If the tag is a program tag, it needs to be prefixed with Program:<Programmname>. using the corresponding program name. If the tag is a structure, you can specify the name of the field to access after a dot ( . ). If the tag (or a structure field) is an array, you can specify an array offset using the syntax [Offset] . |
<Length> | If the tag is an array, you can specify the array length here. It will only be used for reading, because when writing an array, its length will be determined from the value that is written. |
<Type> | If present, contains a type specification, if it cannot be derived from the CoDaBix type. Currently, the following types can be specified: • STRING:<MaxLen> : Specifies the maximum string characters if the variable is of type String or String-Array . This can be used for user-defined String types; otherwise the predefined STRING data type with a maximum of 82 characters will be used. |
Value Type | Path | Meaning |
---|---|---|
Int16 | Local:1:O.Data | Data field (INT ) of the digital output (Int16 contains bitmask of the 16 digital outputs (Digital Output Points)) |
Int16 | Local:1:I.Data | Data field (INT ) of the digital input (Int16 contains bitmask of the 16 digital inputs (Digital Input Points)) |
Int32 | MyControllerTag | Controller Tag MyControllerTag (DINT ) |
Int32 | Program:MainProgram.MyTag1.MyField1 | From program MainProgram the tag MyTag1 (Structure) using field MyField1 (DINT ) |
Byte-Array | Program:MainProgram.MyTag2, 20 | From program MainProgram the tag MyTag2 (SINT[20] ) with length 20 (range 0..20) |
Byte-Array | Program:MainProgram.MyTag2[2], 16 | From program MainProgram the tag MyTag2 (SINT[20] ) from index 2 with length 16 (range 2..18) |
Byte-Array | Program:MainProgram.MyTag3[4].MyField1[1], 5 | From program MainProgram the tag MyTag3 (Structure[5] ) at index 4 the field MyField1 (SInt[10] ) from index 1 with length 5 (range 1..6) |
String | MyStringTag1 | Controller Tag MyStringTag1 (STRING with max. 82 characters) |
String | MyStringTag2, STRING:20 | Controller Tag MyStringTag2 (user-defined String type with max. 20 characters) |
String-Array | MyStruct.MyStringTag3[2], STRING:20[3] | Controller Tag MyStruct (Structure) using field MyStringTag3 (user-defined String type with max. 20 characters) from index 2 with length 3 (range 2..5) |
The Allen-Bradley Device Plugin provides different status information depending on the layer to inspect. In general the channel-based diagnostic information is produced by the connection status of the channel to the PLC. The variable-based diagnostic information is produced during the read/write access of the different variables.
To monitor and diagnose the status of a Allen-Bradley Channel, take a look at the following image:
The image above depicts the Allen-Bradley Channel's Control Panel which displays all status relevant information. The control panel will automatically update its status information when a new status is available.
Status Circle
To monitor and diagnose the status of the different variables, take a look at the variable's Status
property displayed in CoDaBix. Use the button “Read actual Value” to read the values from the PLC and store the result into the variables.
Common error messages:
All channel related status information is also logged into the channel-specific log file stored in the [LoggingFolder]
. Each log file is named in the naming scheme Allen-Bradley Device.<ChannelName>.log
.
The content of such a log file can look as follows:
... 2018-04-11 11:32:37.0 +2: [Error] Error (Severity=High): Code=[-1], Text=[The operation has timed-out.], Details=[] ...
Like every device plugin the Allen-Bradley Device Plugin extends the basic CoDaBix Device Model.
The plugin's device type AllenBradleyDevice
also defines the AllenBradleyDeviceChannel
and therefore extends the basic CodabixDevice
and CodabixDeviceChannel
entities. While the AllenBradleyDevice
just represents a concretization of the CodabixDevice
, the AllenBradleyDeviceChannel
extends the CodabixDeviceChannel
with the Allen-Bradley Variable Entities.
Each channel is handled by a channel worker which establishes a TCP socket connection to the PLC.
By default, the worker does not read any values. When a client or plugin requests a synchronous read of the channel's variables in CoDaBix (e.g. using the CoDaBix Web Configuration's function “Read actual value”), the channel worker reads them from the underlying PLC and then writes them into the corresponding CoDaBix Nodes.
Similarly, when a client or plugin writes values into the channel's variables, the channel worker will write those values to the underlying PLC.
To have an Allen-Bradley variable being read steadily, you can edit the Node in the CoDaBix Web Configuration and set “History Options” to Yes
(which will create an internal subscription), or you can use e.g. a OPC UA Client connected to the OPC UA Server plugin and create a subscription for the Allen-Bradley variable Nodes. In these cases, the channel worker reads the variables from the PLC at a regular interval and, if the value of one of the variables has changed, writes the new value into the corresponding CoDaBix Node.
Content | Path | Usage |
---|---|---|
AssemblyFolder | <CodabixInstallDir>/plugins/AllenBradleyDevicePlugin/ | Contains the plugin's assembly file. |
ConfigFolder | <CodabixProjectDir>/plugins/AllenBradleyDevicePlugin/ | Contains the plugin's configuration file. |
LoggingFolder | <CodabixProjectDir>/log/ | Contains the plugin's log files. |
Type | Path | Usage |
---|---|---|
Assembly | [AssemblyFolder]/CoDaBix.AllenBradleyDevicePlugin.dll | The plugin's assembly file. |
Logging | [LoggingFolder]/Allen-Bradley Device.<ChannelName>.log | The log file. |
Date | 2019-11-11 |
---|---|
Version | 1.0 |
Name | Allen-Bradley Device Plugin |
---|---|
Node | /System/Devices/Allen-Bradley Device |
Version | 1.0.0 |
Name | CoDaBix.AllenBradleyDevicePlugin.dll |
---|---|
Date | 2019-11-11 |
Version | 1.0.0.0 |