Directly access Contrologix PLC tags through Kepware

This is something I learned last week while working with Kepware Tech Support. It makes accessing array bits quite easy…

We use KepServerEX (V5.4) as our OPC server as we have quite a few different PLC types that we need information from. While I know that IA has OPC drivers for Logix PLC’s, we have opted to remain on a single platform for all of our OPC communications… That said…

In my KepServerEX Configuration, my Logix PLC is setup and I pulled in the tag database from the device. This takes care of most everything I need to get at through my Ignition project… with the exception being that it will only pull in a reference to the first element of an array, not the individual bits in the element…

We have a lot of alarms in our systems that are set as bits in DINT arrays. These are easily configured and accessed by the Alarm system in my FactoryTalk ME HMI systems. The problem for me was getting the bits into my project in Ignition to collect Alert Information without having to configure each individual bit I needed in Kepware… Here’s the solution we came up with…

In KepServerEX, configure an Alias Map to the Device (Edit - Alias Map). Let’s name it ‘Dynamic’.

Now, because I have pulled the database into my Kepware project, I have access to the direct address of the array tag without having to guess at what it is… This tag lives in the Main Program scope of my Logix project, so if I browse to the array element I need in Kepware, I find the address to be ‘PROGRAM:MAINPROGRAM:AP10_ALARMS[0]’

In Ignition, I setup a Standard Transaction Group for my Alerts and browse the OPC server to the Array Element tag I need to get the bits out of and drag it onto my group. I then edit the tag, change the name to something I want, change the type to a Boolean and set the target type to ‘None, Read Only’…

In order to get at my bits… in the OPC Item Path, I erase everything after the ‘s=’ and paste the address that I got from the Kepware tag plus the bit and type designation… i.e.

ns=2:s=Dynamic.PROGRAM:MAINPROGRAM.AP10_ALARMS[0].0@Boolean

The number after the n= may be different for you…

As you can see, after the s=, you have the Alias name you setup in Kepware; a dot; the physical address name of the tag you want to read; the [element number].bit and the @boolean.

Once you have one point entered into the system, you can copy & paste or export it and make as many as you need (this is where a .csv export option would be very handy… doing this in xml is just ridiculous… unless anyone has a good editor they could recommend that makes as easy to deal with as a .csv file is)

Please feel free to comment and let me know if there is a better way or if any of this is confusing in any way…

Thanks…