INT to Dint UDT

JeffKiper

Lifetime Supporting Member + Moderator
Join Date
Jun 2006
Location
Indiana
Posts
2,460
I have a MSG from a PLC5 that I need to get into a UDT. I don't like using 16 MOVe anybody got a better way of doing it?
 
Last edited:
big and clunky.
I have to track 130 groups of 16 INTs over 24 hrs. I want to use a UDT to pack all of this info into a group that mean something.
 
If you have a DINT array in the UDT and you do a copy then you'll just end up with some funny numbers. However you could use a single FAL instruction to move from the INT array used by the message instruction into a DINT array in a UDT. If the UDT doesn't employ a DINT array though then 16 MOVs will be the best.

Bear in mind that although its a tiny bit more work for you, its sixes when it comes to the work the processor does. More keystrokes have probably been used in this thread than in programming 16 MOVs.


(edit - since you posted while I was typing I see that you are working with 130 groups. In that case I would create a subroutine (or maybe an AOI) where I passed in the UDT and array and then returned the UDT.)
 
Last edited:
I just typed out the 16 MOVes. I would like to use an Dint_From_Mixer_6[From_Mixer_6[0]].Step_0_Start_Mix so I could use an MOVe data into the UDT that corresponds to the UDT number that location. Of course this doesn’t work so I think I have a work around Dint_From_Mixer_6[index_number]Step_0_Start_Mix
 

Similar Topics

I have a Structure in my project which has a few nested UDTs. They are ultimately of type DINT. What I would like to do is copy the values out of...
Replies
5
Views
2,250
The PLC program I'm monitoring has a UDT of alarm booleans. 36 in total. What I'm trying to do is monitor a few rungs, and also monitor a possible...
Replies
3
Views
1,599
Hi All, I cannot seem to find a way to move a Boolean from an Arrays UDT into a DINT. I have an Array of 32 elements with a UDT data type of 4...
Replies
3
Views
1,740
Is there a way that you can add individual descriptions to each bit member of a DINT in a Studio5000 UDT? I use bits on a DINT for my individual...
Replies
3
Views
1,553
First off I am new to this site so please let me know if I am posting anything improperly or if there is anything I need to do differently. I have...
Replies
6
Views
8,142
Back
Top Bottom