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,470
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
5
Views
40
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
110
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
110
I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
67
Back
Top Bottom