For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connecting an Allen-Bradley ControlLogix PLC

How to read controller and program tags from a Rockwell Automation Allen-Bradley ControlLogix PLC over EtherNet/IP and map them into an ISA-95 style MQTT topic hierarchy.

This guide shows you how to read tags from a Rockwell Automation Allen-Bradley ControlLogix PLC with the Connectware EtherNet/IP connector and map them into an ISA-95 style MQTT topic hierarchy. The connector addresses the named tags of the Logix controller directly, so the same approach works for ControlLogix and CompactLogix controllers. The data collected here (machine state, part counter, temperature, and cycle time) is the typical input for machine monitoring and OEE dashboards. In more detail, the following topics are covered:

  • Understanding how the EtherNet/IP connector addresses Logix tags

  • Distinguishing controller-scoped and program-scoped tags

  • Preparing the controller and the network

  • Mapping the tags into an ISA-95 style MQTT topic hierarchy

  • Verifying data in the Data Explorer

This guide focuses on reading data from the controller. For write operations and the request/response read pattern, see the EtherNet/IP connector reference.

A complete example file is available at the end of this guide.

Prerequisites

To follow this guide, you will need the following:

  • A running instance of Cybus Connectware.

  • An Allen-Bradley ControlLogix or CompactLogix controller that is reachable over Ethernet from Connectware. The connector communicates through the EtherNet/IP port of the controller using Common Industrial Protocol (CIP) explicit messaging on TCP port 44818, so this port must be open on any firewall between Connectware and the controller.

  • The names of the tags you want to read, for example from the tag database of the Studio 5000 Logix Designer project.

  • Access to the Admin UI with sufficient user permissions.

  • Basic knowledge of MQTT and the Connectware services concept (for example, service commissioning files, connections, and endpoints).

How the EtherNet/IP Connector Addresses Logix Tags

Unlike Modbus/TCP or S7, where you assemble register or memory addresses yourself, Logix controllers expose their data as named tags. An endpoint of the EtherNet/IP connector addresses a tag by its name, exactly as it appears in the controller project:

  • Atomic tags are addressed by their plain name, for example MachineState. The supported atomic data types are BOOL, SINT, INT, DINT, and REAL.

  • Array elements are addressed with an index, for example RecipeSetpoints[0].

  • Single bits of an integer tag are addressed with the bit number, for example StatusWord.0.

Every tag in a Logix project has a scope, and the scope decides how the endpoint addresses it:

  • Controller-scoped tags are global to the controller. Set only the tagName property.

  • Program-scoped tags are local to one program, and different programs can contain tags with the same name. Set the programName property in addition to tagName. Alternatively, the tagName property accepts the fully qualified form Program:<program name>.<tag name>, for example Program:Palletizing.CycleTime. Both notations address the same tag; this guide uses programName because it keeps the tag name identical to the controller project.

For details on tag scopes and external data access, see the Logix 5000 Controllers Data Access Programming Manual.

Preparing the Controller and the Network

Reading tags over CIP explicit messaging is a native function of every Logix controller, so no PLC-side program change and no additional communication instruction is needed. Check the following points before you connect:

  • External access of the tags: every tag in Studio 5000 Logix Designer has an External Access attribute (Read/Write, Read Only, or None). Connectware can only read tags whose external access is Read/Write or Read Only. Tags set to None are invisible to external devices.

  • Slot of the controller: in a ControlLogix chassis, the connection enters through the EtherNet/IP communication module and is routed across the backplane to the controller. The slot connection property holds the chassis slot number of the controller, which is slot 0 in many installations but can be any slot. For CompactLogix controllers with a built-in EtherNet/IP port, keep the default slot 0.

  • Network reachability: TCP port 44818 must be reachable from Connectware, as described in the prerequisites.

Choosing the Tags

This guide reads a small set of tags that cover the most common machine monitoring needs. The tag names are examples; replace them with the names from your controller project.

Tag
Scope
Data type
Content

MachineState

Controller

DINT

State code of the machine

GoodPartsCount

Controller

DINT

Count of parts produced without defects

ZoneTemperature

Controller

REAL

Temperature of the sealing zone in °C

CycleTime

Program (Palletizing)

REAL

Duration of the last cycle in seconds

Subscriptions of the EtherNet/IP connector are change-based: the connection scans all subscribed tags in a fixed interval, the scanRate, and Connectware publishes a value only when it has changed. The scan rate is a property of the connection and applies to all its endpoints. The default is 200 ms; this guide uses 500 ms, which is fast enough for machine monitoring and reduces the load on the controller. For all endpoint properties, see EtherNet/IP Endpoint Properties.

Writing the Service Commissioning File

The service commissioning file contains all connection and mapping details. Do not worry about copying the snippets together into one file, the complete example file is available at the end of this guide.

Description and Metadata

These sections contain general information about the service commissioning file. Only the metadata name is required.

Parameters and Definitions

We define the network address and the chassis slot of the controller as parameters, so you can set them when you install the service.

The MQTT topics in this guide follow an ISA-95 style equipment hierarchy (<enterprise>/<site>/<area>/<line>/<work-cell>). We define the prefix once in the definitions section and reuse it in every mapping with !sub.

Cybus::Connection

The connection resource establishes the EtherNet/IP connection to the controller. The slot property routes the connection to the controller in the chassis, and the scanRate property sets the interval for scanning the subscribed tags for changes. The connectionStrategy object controls how Connectware retries failed connection attempts with increasing delays. For all connection properties, see EtherNet/IP Connection Properties.

Cybus::Endpoint

Each endpoint subscribes to one tag. The controller-scoped tags only need the tagName property:

The CycleTime tag is local to the Palletizing program, so the endpoint sets programName in addition to tagName:

Cybus::Mapping

The mapping publishes each endpoint on a topic of the ISA-95 hierarchy.

With this mapping, the machine state is published on the topic enterprise/hamburg/packaging/line-1/palletizer-01/machine/state, and every other tag follows the same pattern.

Installing the Service Commissioning File

  1. Install the service commissioning file. See Installing Services.

  2. Enable the service. See Enabling Services.

Result: The service is enabled. Connectware establishes the EtherNet/IP connection to the controller and starts scanning the subscribed tags.

Verifying the Data

Open the Data Explorer and subscribe to enterprise/hamburg/packaging/line-1/palletizer-01/#. Each topic carries a JSON object with the keys timestamp, value, and oldValue, where value is the current tag value and oldValue is the value of the previous scan:

Because the subscription is change-based, a message only arrives when a tag value changes. A constant tag stays silent after the initial value.

A few plausibility checks for the first readings:

  • The state code on the machine/state topic matches the state shown on the HMI of the machine.

  • The counter on the counters/good-parts topic only increases while the machine produces.

  • The temperature on the temperature/sealing-zone topic is in a plausible range and changes slowly.

If the connection does not reach the Connected state, verify that TCP port 44818 is reachable from Connectware and that the slot property matches the chassis slot of the controller. If the connection is established but an endpoint delivers no data, check that the tag name and program name exactly match the controller project and that the External Access attribute of the tag is not set to None.

Service Commissioning File Example

Disclaimer: Allen-Bradley, ControlLogix, CompactLogix, and Studio 5000 are trademarks of Rockwell Automation, Inc. EtherNet/IP is a trademark of ODVA, Inc.

Last updated

Was this helpful?