Studio 5000, move data UDT

einnh

Lifetime Supporting Member
Join Date
Mar 2014
Location
New England
Posts
275
I have created a UDT in this project that I'd like to be able to use as a template for a series of machines:

unita of type udtvar
unitb of type udtvar
unitc of type udtvar
unit_general of type udtvar

I'd like to copy unit_general values into a, b, or c, however I cannot use a standard := or MOV command in ST. What would be the best method for copying besides setting each individual element of the UDT?
 
You need to use a copy command (COP). That should be one of the commands you can enter on the command line:

COP(Source, Destination, Length);

Keith
 
i'll give it a shot, thanks.

i just switched to adding a bunch of 'if ... then' statements in my logic, im not sure which would be more processor intensive.
 
The COP instruction is pretty cheap in terms of processing. There is not type checking or conversion. It is as close to a raw memory copy as AB has.

Keep in mind that "Length" is in terms of the destination data type. If you wan to copy one UDT instance to another the instruction would look like:

COP (unit_general, unita, 1)

This would copy all of unit_general to unita since the destination data type is the udtvar data type.

Keith
 
Last edited:

Similar Topics

Hi All, I am using 2 MOVE instructions in Studio 5000 logic designer to move 2 different values in the same destination tag N7[190]. Two...
Replies
16
Views
4,535
Hi Everyone, I am facing an issue while installing the STUDIO 5000 in my windows 10 PC. During installation I am getting an error that " Error...
Replies
3
Views
98
I am connecting to a remote device. When attempting to upload I receive an error that states: Error: Auto_Functions: The Import was aborted due...
Replies
3
Views
161
I recently did a program conversion from logix 500 to studio 5000 and when machine runs it depends on two ton instructions to keep the machine in...
Replies
17
Views
525
Back
Top Bottom