Tag Based Programming PLC

One common way to solve your issue is to take a different approach - instead of a huge table of variables that are offset only by some index number, many would prefer to create a data type. Under Derived Data Types in Unity, create a type of <struct> and populate with all the variables you need for ONE machine. Since you are only changing the machine ID, I am assuming all your machines are the same. Once this data type is defined, in the variable editor you can create one tag of this type, and it will be populated with all the tags for the machine. If your machine naming is linear, you can even just create an array of of this new data type.

An example: create a DDT called ExpMsgCntrl that contains all the actual variables I need for operating explicit messages on an M340 platform:

Struct.jpg

Then create an array of 10 of these (an example) for 10 machines:

AddArray.png

You can see if we open the first layer there will be ten of these structures, one for each machine:

Layer1.png

Then open one of the specific machine structures and all of the variables we defined were there:

Layer2.png

I like this organizational approach as it is much faster for me to create this and maintain it during development than having separate linear sets of variables. If you find you need another variable, or have to change the type of something, just go back and make one change in the DDT structure, and all instances are updated automatically. Otherwise, each change must be done for each machine, so 10 machines is 10 changes.
 

Similar Topics

I have just finished a project where the software was designed strictly for tag based programming. The most painful experience of my life and so...
Replies
37
Views
12,427
I seem to be making this harder than it should be, and Its not making any sense. I simply need to move a real variable to two integer variables...
Replies
8
Views
992
Hello, I am upgrading some custom AOI's for a customer that was using plantpax 3.5 they are moving to Pax v5. In their old AOI's they were...
Replies
0
Views
541
Good afternoon everyone. Just starting to use Logix based tag alarms, and I am likely a little confused. What I would like to do: Use Logix 33...
Replies
5
Views
1,872
Hi all, We have been using an UDT that contains tag-based alarms as an In/Out parameter for an AOI. (V31-V32) Unfortunately, V33, they have...
Replies
0
Views
1,102
Back
Top Bottom