UDT breakout

JeffKiper

Lifetime Supporting Member + Moderator
Join Date
Jun 2006
Location
Indiana
Posts
2,460
Detailed story at the bottom of this post.
The real question is do you know of a clean way to breakout all of the sub elements in a UDT? I have 66 elements in this UDT. They are BOOL, REAL, & Timers. They are mixed around so I have 11 BOOL, 3 REAL, a few BOOL, a few REAL, a few TIMER, etc. etc. I have 12 of these TAG that are 66 sub elements long.
I have to break each sub element out in to individual tags. The only way I see to do this is BRUTE FORCE. There are no arrays, no BOOL packed into DINT. Straight forward tags in a UDT.

XIC TAG1.BOOL1 OTE TAG1_BOOL1
XIC TAG1.BOOL2 OTE TAG1_BOOL2
XIC TAG1.BOOL3 OTE TAG1_BOOL3
MOV TAG1.REAL1 TAG1_REAL1
MOV TAG1.TIMER1.ACC TAG1_TIMER1_ACC
.
.
.
XIC TAG2.BOOL1 OTE TAG2_BOOL1
.
.etc


So this will be around 1000 rungs by the time I am finished. Do you have a cleaner way. Each sub element has to be its own tag when I am finished.

I don't know anything about how Siemens is programming their system. I don't even have Siemens software. Please don't ask a question, because I am undereducated to answer your questions about Siemens.
I have a customer that is having Siemens build their BAS (Building Automation System) This customer has a redundant CLX system L55 Ver 13 running a cold room. The system is certified by the DEA (not the correct terminology but you get the point) I can't change any of the PLC in these ControlLogixs. Siemens is trying to read data from the controllers and can only read the Controller scoped tags. They can not read program scoped or controller scoped UDT.

I am going to use a CompactLogix to Message the ControlLogix and do a tag read. The put all of this code in the CompactLogix so Siemens can look at the individual tags of this controller.
 
Detailed story at the bottom of this post.
The real question is do you know of a clean way to breakout all of the sub elements in a UDT?


horrible - Use Excel to code your rungs using vlookup on the UDT data type to determine the data type of the elements hence the type of rung that you are going to create
Also use string manipulation functions Left, Right, Len(ength) and Mid

eg formula in excel in cell A1 = A2 & A3 will concatenate the contents of cell A2 and A3

This means that you can be accurate and not make any mistakes on the 1000 rungs

Alternate If all using the same UDT is to program 1 UDT then use copy paste and then replace only in a forward direction (the Find does not wrap) 12 times
 
Last edited:
I use excel all the time on big jobs like this. I think it is the only way to make sure your code is consistant.
 
Make an AOI for Breakout of Tag Info from UDT. Then you have 66 rungs of logic. Just change UDT input parameter.
 
Make an AOI for Breakout of Tag Info from UDT. Then you have 66 rungs of logic. Just change UDT input parameter.

Assuming you can add an AOI to the original CLX, I would go this route.

If you can't, brute force it is!
 
One other option to consider is doing this in Structured Text -
Use Search / Replace with
<Find Where> set for Current Routine
<Direction> set for down


// TAG1
TAG1_BOOL1 := TAG1.BOOL1;
TAG1_BOOL2 := TAG1.BOOL2;
TAG1_BOOL3 := TAG1.BOOL3;
TAG1_REAL1 := TAG1.REAL1;
TAG1_TIMER1_ACC := TAG1.TIMER1.ACC;


//TAG2
TAG2_BOOL1 := TAG2.BOOL1;

TAG2_BOOL2 := TAG2.BOOL2;
TAG2_BOOL3 := TAG2.BOOL3;
TAG2_REAL1 := TAG2.REAL1;
TAG2_TIMER1_ACC := TAG2.TIMER1.ACC;


//TAG3
TAG3_BOOL1 := TAG3.BOOL1;
TAG3_BOOL2 := TAG3.BOOL2;
TAG3_BOOL3 := TAG3.BOOL3;
TAG3_REAL1 := TAG3.REAL1;
TAG3_TIMER1_ACC := TAG3.TIMER1.ACC;


.
.
.
.

//TAG99
TAG99_BOOL1 := TAG99.BOOL1;
TAG99_BOOL2 := TAG99.BOOL2;
TAG99_BOOL3 := TAG99.BOOL3;
TAG99_REAL1 := TAG99.REAL1;
TAG99_TIMER1_ACC := TAG99.TIMER1.ACC;


No unused tags...
 
You should ask them if they can read arrays. If so you could read each UDT and pack it into an INT or DINT array using a synchronous copy (CPS) and let the Siemens guy figure out how to pull it all apart.

Keith
 

Similar Topics

Afternoon all, I'm working on setting up a large excel recipe table for porting updates through the Linx Gateway RTD/DDE function into my recipe...
Replies
2
Views
112
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
203
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
128
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
313
Hello, I have been looking for a reference for the order that a UDT is copied in the COP instruction. More specifically - I have a set of code...
Replies
5
Views
550
Back
Top Bottom