Overview

Connects to a Siemens S7 PLC (S7-200/300/400/1200/1500) via the S7NetPlus library, reading and writing PLC memory areas (DataBlock, Input, Output, Memory, Timer, Counter).

Parameters

Name Values Description
Type ALLENBRADLEYOMRONTAG The connector type identifier.
IP IP address or hostname The IP address or hostname of the PLC.
Path e.g. 1,0 CIP routing path to the target processor (used for chassis/slot addressing, e.g. through a bridge module). Defaults to 1,0.
PLCType ControlLogix, Plc5, Slc500, LogixPccc, Micro800, MicroLogix, Omron The controller family being connected to. Defaults to ControlLogix.
Protocol ab_eip, or other libplctag-supported protocol names The wire protocol to use. Defaults to ab_eip.
Timeout milliseconds (integer) Per-request timeout for tag reads/writes/initialization. Defaults to 1000.
UpdateRate milliseconds (integer) How often the connector polls all subscribed tags. Defaults to 1000.
ReconnectDelay milliseconds (integer) Minimum time between automatic reconnect attempts while the PLC is unreachable. Defaults to 5000.

Supported Tag Types:

The connector maps onto the standard Industreweb tag types below. For Integer Tag, Decimal Tag, Time Span Tag, and Data Tag - where more than one Allen Bradley elementary type could apply - the specific AB type is selected using a DataType entry in the tag's Parameters. Bool Tag and String Tag don't need this, since each maps to exactly one AB type.

Tag Type AB Data Type(s) Parameters["DataType"]
Bool Tag BOOL Not applicable.
Integer Tag SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT Optional. One of SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT. Defaults to DINT if not set.
Decimal Tag REAL Not currently configurable - always reads/writes as REAL.
String Tag STRING Not applicable.
Date Time Tag STRING Not applicable. AB has no native date/time type; the underlying controller tag must be a STRING holding a parseable date/time. Date Time Tags are more commonly used as virtual/system tags (e.g. $DateTime) rather than an actual PLC address.
Time Span Tag SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT Optional, same values as Integer Tag. Defaults to DINT. Represents a plain numeric duration count; the unit (milliseconds/seconds/minutes/hours/days) is set separately via Parameters["DEFAULTUNITS"].
Data Tag Any of the above, or TIMER (AB TIMER structure: ACC/PRE/DN/TT/EN) Optional. One of BOOL, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, REAL, STRING, or TIMER. Defaults to TIMER if not set.

Note: Integer Tag and Time Span Tag store their value internally as a 32-bit signed integer. If DataType is set to LINT or ULINT, values outside the 32-bit range will be truncated - use a Decimal Tag if the full 64-bit range needs to be preserved.

Note: the AB String data type has a known limitation against Omron controllers - reading/writing a String Tag (or a Date Time Tag, which is backed by String) against an Omron PLC is not currently supported.

Connector Methods

Name Arguments Description
(none) - This connector does not currently expose any custom connector-level methods via Execute Commands.

Addressing

The Address field of each tag is the fully qualified tag name as it appears in the controller, for example:

  • MyTag - a controller-scoped tag
  • Program:MainProgram.MyTag - a program-scoped tag
  • MyArrayTag[3] - a specific element of an array tag
  • MyUdt.MyMember - a member of a user-defined type

The tag name must match the width/type actually configured on the controller - for example, requesting a tag as DINT when it is really an array or a member of a larger UDT will fail to initialize (ErrorOutOfBounds). Where more than one AB type could apply to a tag type (see Supported Tag Types above), set Parameters["DataType"] to match the controller's actual configuration.

Diagnostic Codes

Code Type Description
1010 Error Unsupported tag type encountered while creating a handle
1015 Error A tag's DataType is a 64-bit type (LINT/ULINT) but stores as Int32 - large values will truncate
1020 Error Unrecognised DataType for a tag - falling back to the type's default
1025 Error Unable to initialize a tag added while the connector was already running
1030 Error Unable to create the underlying AB tag handle
1200 Error Unable to initialize a tag during the initial connect/reconnect probe
1215 Error A reconnect attempt did not bring any tag online
1225 Error No tags came online against the PLC on startup
1305 Error A tag read returned a non-Ok status
1310 Error Exception while reading a tag
1405 Error AB tag handle not present for a tag ChangeData was called on
1410 Error Write skipped - tag has never successfully initialized against the PLC
1415 Error A tag write returned a non-Ok status
1420 Error Exception while writing a tag
1510 Error RunMethod called with an unrecognised method name
1600 Error Exception while disposing an AB tag handle during shutdown
1700 Error Unrecognised PLCTYPE configuration value - falling back to the current default
1705 Error Unrecognised PROTOCOL configuration value - falling back to the current default
2201 Debug Connection lost
2230 Debug Invoking Connected
2231 Debug Invoking ConnectionLost
2300 Debug ReadUpdate cycle overran cycleDelay
2325 Debug UDT auto-discovery could not resolve this tag - falling back to raw bytes (reason given in message text)
2400 Debug ITag not present - ChangeData called for an unregistered tag name
3100 Info Connector started
3205 Info Attempting to reconnect to the PLC
3210 Info Reconnected to the PLC
3220 Info Connected to the PLC on startup
3326 Info UDT auto-discovery resolved a tag to a named-field template (template name/id/field count/size given in message text)