Once you connect a PLC to LoopEdge DeviceHub, you can define the PLC registers that DeviceHub will collect data from. Every PLC has memory registers that store sensor and system values, such as the timer counter. The list of registers includes the analog input, the analog output, the digital input, and the digital output.
DeviceHub Tag Overview
A DeviceHub Tag enables data collection from a specific memory location (register) in a PLC. The DeviceHub Tag generates a Raw Topic for publishing data to a message broker for further distribution. LoopEdge can publish data to LoopCloud through IPSO topics and Cloud Connectors.
The LoopEdge message brokering system allows for subscribing from and publishing to local and IPSO (Internet Protocol for Smart Objects) Topics.
- A DeviceHub Tag generates a Raw Topic, the Topic for publishing and subscribing through the local message broker.
- The Raw Topic will be used to configure a DataHub Cloud Connector and Topics to connect to LoopCloud.
- In lieu of LoopCloud, collected data can be viewed at the edge using LoopEdge Flows. See Use LoopEdge Flows to Visualize Data Flows.
The above example shows the tag attributes to configure
Make sure to choose a polling interval greater than 1 second to ensure that the LoopEdge network will not be flooded with unnecessary data.
Add a Tag to DeviceHub
You can add a tag for a single PLC register, or upload tag details with a comma-separated values (.csv) file. This procedure lists the steps for a single register.
A DeviceHub PLC device connection. See DeviceHub Add, Monitor, or Delete Device.
After a PLC device is connected to the LoopEdge IPC using DeviceHub, create tags to define the device registers from which data will be collected.
Note: These steps show an example of a Modbus configuration. Each device driver will have its own specific fields to be configured.
To add a tag for a single register:
- Click DeviceHub from the navigation panel.
- Click Tags from the sidebar.
- Click to the right of the Tags list.
- Select Add One.
Select the Device from the drop-down list. Only devices created in DeviceHub will be listed.
The fields displayed in this Add Tag dialog depend on the PLC device driver type.
- Select the Value Type: string, integer, float, or bit.
- Enter a Tag Name and Polling Interval (in seconds).
- Select/enter a Register Name (Scroll to reference the register table listed at the bottom of the form) and click Add Tag.
Free Tag and OPCUA Driver information:
Certain PLC device drivers, such as Allen-Bradley CompactLogix, will not have a list of register names in the Add Tag form. These are referred to as Free Tags.
- You must enter case-sensitive register names exactly how they are defined in the PLC.
- Devices will not display a Connected status until a tag with a correct register name is created. See Troubleshoot Device Connectivity Status.
- For OPC UA, map the OPC server tags to the client. Enter the Register Name using this format, where the semicolon is significant:
Subscribing to DeviceHub Topics
To receive data from device registers, you will need to subscribe to Topics. LoopEdge Flows provides ways to Subscribe to All Topics or to Individual Topics. You can also use to view data from subscribed Topics in LoopCloud.
Wildcards allow you to easily subscribe to multiple topics and receive data from each one.
When you start adding DeviceHub Tags, you will notice that each topic starts with similar characters. Topics support the following Wildcard characters for subscribing to multiple topics:
> Wildcard Character: To subscribe to multiple topics, you can use the > character. You can use devicehub.raw.75B8BB04> to subscribe to the 3 topics in the above screenshot, for example. This allows you to receive the messages from multiple Tags.
* Wildcard Character: You can use the * wildcard character in order to match a single token between . characters in tags. Thus, using devicehub.raw.*.* will match all topics that start with devicehub.raw and have two character sequences after each of the two . characters.