How to copy UDT data in CLX?

citizen423

Member
Join Date
Nov 2010
Location
chattanooga
Posts
9
I have created a UDT (profile) it consists of 59 elements one of which is a string that contains the name of the profile that can be changed via the HMI duriing the recipe profile set up. I have used this UDT in an array of 10 for
RecipeSet[0]
...
...
...
RecipeSet[9]

When the user presses a recipe select button on the HMI all of the data in the selected recipe should be moved to
ReceipeInQue
This data type is the same.
Then when the current profile is finished running and the user presses a load button i then should move
RecipeInQue
to
RecipeRun
Same data type again.

This in my mind should be easy but for some reason the proccessor wants to fault out when I move this data and I find negative values in some timers that are unrelated to these tags. Im guessing I have some data rolling over. Am I making a mistake by moving all the data at once including the string from one UDT to another?
 
Use a length of 1 when you copy. The length is the size of the destination element, and you are copying one element. Anything else and you will over-run the boundary, putting garbage in other tags.
 
ok, I started by using a length of 59 and I changed my lenght to 1 in programs 1-3 but not in programs 4 and 5 and my tags were staying messed up in program 6. (this plc is actually running 6 different chambers.)
I will change them all and give it a try.
Thank you!!
 

Similar Topics

Hello! I am completely new to PLCs, so I apologize in advance if this is a dumb question. I have a device that sends out its data as a number of...
Replies
5
Views
2,130
I am sure this topic has been discussed before. But there are so much topics about pointers etc. that it's hard to find what I am looking for. So...
Replies
20
Views
11,254
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
125
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,593
I have a separate program running for user security that i need to interface with existing security within my program. All of the external program...
Replies
1
Views
1,152
Back
Top Bottom