Copying UDT member data

Snap25

Lifetime Supporting Member
Join Date
Dec 2014
Location
Michigan
Posts
237
I created a UDT with recipe parameters and have created several Recipe tags using that UDT as a data type, as well as an "Active_Recipe" tag.

if RunMode_Active_Trigger = 1 & Production_Selection = 1 then

COP(RecipeParameter_1,Active_Recipe,1);

elsif RunMode_Active_Trigger = 1 & Production_Selection = 2 then

COP(RecipeParameter_2,Active_Recipe,1);

elsif RunMode_Active_Trigger = 1 & Production_Selection = 3 then

COP(RecipeParameter_3,Active_Recipe,1);


….. and so on.


Is the COP legth correct? Will that COP all of the UDT's member values?
 
The length is correct. Also, bools don't need "=1", they can just be examined. Use "not" in place of "=0". Also "Case" would be a cleaner way to program this than "elsif" ad nauseum.
And USE TABS!!!!
 

Similar Topics

Hello all! Is it possible to COP a SINT array to a UDT structured the same as a SINT array, except all BOOL bits? I have a module that has an...
Replies
5
Views
3,158
Hi All, In RSLogix 5000 (or Studio 5000), is there a way to easily copy all the tag values from an UDT instance to another UDT instance (same UDT...
Replies
2
Views
2,329
I have an application where I am allowing the user to edit 4 different XY value tables using 2 columns of numeric indicators on the Panelview. I...
Replies
4
Views
3,725
I'm trying to reverse engineer a client's program. They are sending Logic Command and Speed Reference over DeviceNet to a PowerFlex 40P VFD. The...
Replies
2
Views
3,257
I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
296
Back
Top Bottom