This lesson is part of the OPC UA and Devices in Ignition course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off

Supplemental Videos

Description

Modbus devices don't support browsing. Learn how to use the Modbus address mapping feature of Ignition to create a browseable list of Tags.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] Now that we know how to manually create tags for a Modbus device connection, let's leverage the Modbus driver's address mapping feature to create a large number of tags simultaneously. In our gateway, we'll go to the config tab, scroll down to the OPC UA section, and select device connections. We'll just verify that our Modbus device is connected, and then we can click on this more dropdown. Let's select addresses, and the Address Configuration for Modbus page will open. This page allows you to define multiple ranges of addresses in the device that will later be exposed in Ignition's OPC UA server via the Connected Devices window. I'll start by clicking Add Row. A new row will appear and I can configure a mapping here. In this example, I'm going to add this V prefix -- V underscore. This will form part of the name for each of the mapped items. You can use any prefix you like except for designators used by the driver such as HR or C.

[01:07] For more information on Modbus address mapping and reserved prefixes, please see the link to the Ignition user manual below this video. So each of the items created by this row will now be assigned the name V_, followed by a number. Now, let's consider the start and end. The number of items Ignition creates for this range depends on the start and end values we enter. As of Ignition 8.1.42, The start and end range must be set between zero and 65,535. The gateway will throw an error if star and end values are outside of that range. So for this example, I'll put in zero for start, a nine for end. With that range in place, it will create 10 items, all with a prefix of V underscore-- V_0, V_1, and so on. I'm going to skip over the Step and Unit ID for this example.

[02:05] Let's leave the Modbus type as Holding Register Int16. Then we'll need to specify a Modbus address. This corresponds to the location on the holding registers table where we're going to start with the zero value. In this case, I'm going to say our Modbus address is one for the first address on the holding register table. In other words, V underscore zero would be Modbus address one, v underscore one would be Modbus address two, and so on, counting up by one each time. Now we can save our work and the device connection will reinitialize. While it's doing that, let's go take a look at the OPC Quick Client. I'll scroll down to the OPC Client section and select OPC Quick Client. Here, we can expand the Ignition OPC UA server, then devices. We'll open up the Modbus device connection and look for the new Unit ID folder. Let's expand that, and we can see a new V_zero to V_nine folder.

[03:03] Inside that, we can see each of our mapped items. So now, I can go into my designer, browse my connected devices, drill down to my new V_ folder, drag these V's into the tag browser, and create a bunch of Ignition tags all at once. Now let's take a look at another example in our gateway. We'll head back to the OPC UA section and navigate back to our connected devices page. Here, I'll click on the more dropdown again next to my Modbus device and select addresses. This time, I have multiple configurations saved as a CSV that I'd like to import using the import configuration functionality. I'll click on choose file and browse to find the CSV file I want to import. Before I click on this import configuration button, I want to point out that importing a configuration will wipe out the prior rows here.

[04:03] If you already have some configurations defined, you could instead export and merge those into the file you want to import. That way, you'd have all your configurations in a single file. Now, I'll click the import configuration button. You can see it imported a bunch of new rows from that CSV file. Before I click on the save button though, let's take a quick look at the radix. By default, we're starting with a radix of 10, so all these mapped items we're creating are 10-based. In some scenarios, it may be preferable to make it eight-based or octal instead. So let's change the radix to eight and take a look at the end result once we save our values. Let's head back to the OPC client section and go into our OPC Quick Client again. We can drill down to our OPC UA server, devices, Modbus device Connection, and Unit ID zero. We have multiple folders here now, one for each row we imported in. Because these are octal values, we start at CC zero, go to seven, and then jump to CC 10.

[05:09] So, even though the Modbus protocol isn't browsable, you can use the Ignition address mapping feature to create browsable areas of the device and then create a large number of tags in just a matter of seconds.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.