Ignition Bit of Word Control Logix

robertmee

Lifetime Supporting Member
Join Date
Feb 2008
Location
NC
Posts
1,938
First large job with Ignition and CLX. Having to integrate to an existing PLC Program which has everything mapped to an Array of DINTs for HMI Control/Status.

So for example, a Conveyor has
HMI[0].0 Start PB
HMI[0].1 Stop PB
HMI[0].2 Run Status
HMI[0].3 Permissive
etc.

Next conveyor follows same format except HMI[1].x

In ignition I can browse the UA OPC Server and drag the entire Array of HMI into the tag browser. Ignition then creates 100 tags of INT4 in the format of
HMI_0_
HMI_1_
HMI_2_
etc.

There are no bit level tags, and in the Indicators/Controls, accessing the bit level using a DOT field doesn't work. So, pointing an animation to HMI_0_.0 does not work. The ONLY way I have found to make this work is to manually create a Boolean Tag in the Ignition Tag Database, eg HMI_0_0 and change the path to point to HMI[0].0. That works, so the UA Driver is capable of accessing the bit level. But not only is that tedious, it turns an array of 100 DINTs into 3100 booleans to try and manage and put on the comm stack.

I cannot believe that once a DINT or INT tag is updated in Ignition, it doesn't allow a DOT field access like every other SCADA package.

At this point I either manually copy/paste boolean tags or export/import to JSON files and manually use an XML editor to create the tags. But again this creates huge overhead of tags on the comm stack and in the tag browser.

Certainly this has had to come up multiple times. All my google searches of the Ignition forums say to create manually boolean tags. But for a large program that's crazy. The other alternative is to rewrite the PLC and use UDTs instead of the DINT arrays, which ignition seems to handle just fine.
 
This is something I had to get past in my Ignition early days.

If, you just need read only then you can use the getBit() expression against the DINT tag, makes it pretty simple to replicate traditional bit-level animations. If you want to write the value you could call system.opc.write() and specify the item path and essentially bypass the Ignition Tag system.

I need simple read/write to bools so I create the individual Boolean tags. But, let Ignition do the heavy lifting for me. I create an Ignition UDT that builds itself whenever I create a new tag.

For example, create a new UDT called "HMI BOOLs". To make it more configurable, add a couple of parameters.
1. OPC Server Name
2. OPC Topic

By defining the parameters you can easily point to other PLCs that may require the UDT.

Create a new OPC tag within the HMI Bools definition, call it "0", set it as boolean.

For the OPC Server, use the expression: {OPC Server Name}, your OPC Server is now parametrized.

For the OPC Item Path, I want the UDT to automatically build it for me using the custom and built-in parameters:
[{OPC Topic}]{instancename}.{tagname}

Now, copy the tag "0", then paste 31 times. Your UDT structure now has 0, 1, 2, 3,...31 tags.

Lets create an instance of this UDT.

Ignoring your PLC HMI[0] array, lets just call it "HMI" instead for the basics of this exercise.

If I create a new Ignition tag called "HMI", as a "HMI Bools" UDT, then set the OPC Server, OPC Topic parameters appropriately,

The Ignition Tag will automatically create, and configure itself for the bools.

New tag appears: HMI
Within the new tag: HMI/0, HMI/1, HMI/2...etc.

The OPC item paths should be: [robertmee_opc_topic]HMI.0, [robertmee_opc_topic]HMI.1, [robertmee_opc_topic]HMI.2...etc

You could expand on this example to accommodate your array structure by adding a folder in the UDT to represent the array element, then having 0..31 opc tags within the folder. Create as many folders as you need to match the PLC array size required. This is just a basic idea, but you could easily change to your liking.

Also, don't rely on drag/drop from the OPC browser, find ways to better optimize for development. The only time I use drag/drop from OPC is during commissioning and I need to quickly get data from third-party systems. I always create Ignition UDTs to align with my PLC, it has served me very well and makes scaling up easy.
 
Last edited:
Some further thought, given you are using Ignition you should try and drop some antiquated habits.

Within Ignition, create a useful UDT that's a bit more readable:

Name: ConveyorControl

Parameters:
OPC Server
OPC Topic
Conveyor Number

Tags:
Start PB ([{OPC Topic}]HMI[{Conveyor Number}].0)
Stop PB ([{OPC Topic}]HMI[{Conveyor Number}].1)
Run Status ([{OPC Topic}]HMI[{Conveyor Number}].2)
Permissive ([{OPC Topic}]HMI[{Conveyor Number}].3)

------------------------------------------------------------------
UDT Instances:

Conveyor 1
- Start PB
- Stop PB
- Run Status
- Permissive

Conveyor 2
- Start PB
- Stop PB
- Run Status
- Permissive

Much easier to work with.
 
Yep, you are approaching it wrong. Create a udt and then you just pass the basetag. I'll agree that it would be nice if they allow bit level addressing, but unfortunately they don't.
 
I'm with Paully, particularly post #3.


Packing bits into INT's is a solution for a problem that doesn't exist with Ignition - tag-based licensing. If more tags = more $, then it makes sense to do it. But if your tag count is irrelevant - why go to the effort of packing and unpacking tags? Create a UDT, and one instance of that UDT for each motor, and be done with it.

I found myself going through this process with Ignition several times when I first started using it:
1. How do you do this in Ignition?
2. It's possible to do it this way or this way, but that seems tedious...I must be approaching this the "wrong" way
3. Aha, I don't even need to do this in Ignition because I can just do XYZ instead, which bypasses the need to do this
4. In fact, the only reason I ever needed to do this in the past was because of limitations in other HMI/SCADA packages that don't exist in Ignition
5. Why do I ever use anything other than Ignition?
 
Thanks for the help, All.

Yes, Pauly, that's what I'm doing now...creating the UDT's in Ignition. Got some help from the Ignition forum, and their response was almost verbatim to yours with some nice screen shots. Wonder if you guys are one in the same :)

In regards to old habbits, I use alot of code that has to be cross platform both PLC and HMI. Wonderware, FactoryTalk, even the old RSView32 and ME stuff all had easy bit of word access, and using DINT arrays made search/replace quick and easy. This is my first foray into Ignition. Like what I see so far, and alot of configuration power. Was just caught off guard by what I feel is simple...bit of word access, especially since the data already resides in the SQL tags.

ASF, agree, but alot of legacy code to deal with that used this methodology. If I had time, I'd probably rewrite the PLC code and use UDT's in the code instead and then that structure is replicated in Ignition with an OPC drag.
 
Wonder if you guys are one in the same :)

It's not obvious? :ROFLMAO:

In regards to old habbits, I use alot of code that has to be cross platform both PLC and HMI.

Understandable, I've been there.

Best advice I can give is to let go of old habits, they will inhibit your creative juices when it comes to what you can do with Ignition and hold you back. I'd compare it to emulating PLC5 memory structures in a ControlLogix.
 

Similar Topics

Hey guys. We've been learning Ignition and going through all the courses on Inductive University. I really like the software and the things you...
Replies
20
Views
1,024
Hardware: 5069-L320ERMS2 Software: Logix Designer 35.11 / Ignition 8.1 Issue: When attempting to write to the tag "HMI_DRV200_DynamicTrim" in...
Replies
5
Views
729
Hi all, happy new year! I read a topic lately and many more before that where a lot of people saying that Ignition is damn good SCADA, so I...
Replies
1
Views
293
Hello, using Ignition I want to automatically change the time zone for 30 Allen Bradley plc's at the same time, is there an efficient way to do...
Replies
2
Views
409
With Wonderware, IFIX, FactoryTalk View, etc., it's very easy to have multiple HMIs, each with their own independent control, looking at the same...
Replies
2
Views
504
Back
Top Bottom