recondaddy
Member
First time poster -- Great Forum!!
I am currently writing logic to move product from (8) packaging machines down to (6) palletizing robots. I am writing the code for the conveyor controls while the robot vendor is writing code for the robots, themselves.
One of my colleagues coordinated with the robot vendor, the naming of tags that reside in my controller that will be used by the robots.
For simplicity's sake, lets say that two pieces of data need to be moved into these tags for consumption by the robot PLCs -- Data_1 and Data_2.
Here's the problem: Had I named the tags, I would have created an array of (6) DINTs for each piece of data -- one for each robot. That way, I could use the Robot Number as the array index (subscript) for each piece of data. For example:
Data_1[0] for Robot 1
Data_1[1] for Robot 2
Data_1[2] for Robot 3
etc., etc.
Data_2[0] for Robot 1
Data_2[1] for Robot 2
Data_2[2] for Robot 3
etc., etc.
If I wanted to move data into the registers for Robot 1, I could simply use indirect addressing like this:
Robot_Num = 0
Data_1[Robot_Num]
Data_2[Robot_Num]
Instead, my colleague named the tags like so:
Robot1_Data[1]
Robot1_Data[2]
Robot2_Data[1]
Robot2_Data[2]
As you can see, the Robot Number is contained in the tag NAME, instead of the array subscript. I assume that there is no way to use the Robot Number as the tags are currently named, correct?
I'd like to be able to alias the array elements he created with my own, but I'm sure I can't do that in CLX:
Data_1[0] aliases Robot1_Data[1]
Data_1[1] aliases Robot2_Data[1]
Data_1[2] aliases Robot3_Data[1]
...
...
Data_1[5] aliases Robot6_Data[1]
================================
Data_2[0] aliases Robot1_Data[2]
Data_2[1] aliases Robot2_Data[2]
Data_2[2] aliases Robot3_Data[2]
...
...
Data_2[5] aliases Robot6_Data[2]
Anyone have any wisdom to share? My current options are:
1) Coordinate with the vendor and change tag names (??Likely??)
2) Write 48 "what-ifs" in logic (6 robots x 8 machines)
Thanks for any help you can provide!
I am currently writing logic to move product from (8) packaging machines down to (6) palletizing robots. I am writing the code for the conveyor controls while the robot vendor is writing code for the robots, themselves.
One of my colleagues coordinated with the robot vendor, the naming of tags that reside in my controller that will be used by the robots.
For simplicity's sake, lets say that two pieces of data need to be moved into these tags for consumption by the robot PLCs -- Data_1 and Data_2.
Here's the problem: Had I named the tags, I would have created an array of (6) DINTs for each piece of data -- one for each robot. That way, I could use the Robot Number as the array index (subscript) for each piece of data. For example:
Data_1[0] for Robot 1
Data_1[1] for Robot 2
Data_1[2] for Robot 3
etc., etc.
Data_2[0] for Robot 1
Data_2[1] for Robot 2
Data_2[2] for Robot 3
etc., etc.
If I wanted to move data into the registers for Robot 1, I could simply use indirect addressing like this:
Robot_Num = 0
Data_1[Robot_Num]
Data_2[Robot_Num]
Instead, my colleague named the tags like so:
Robot1_Data[1]
Robot1_Data[2]
Robot2_Data[1]
Robot2_Data[2]
As you can see, the Robot Number is contained in the tag NAME, instead of the array subscript. I assume that there is no way to use the Robot Number as the tags are currently named, correct?
I'd like to be able to alias the array elements he created with my own, but I'm sure I can't do that in CLX:
Data_1[0] aliases Robot1_Data[1]
Data_1[1] aliases Robot2_Data[1]
Data_1[2] aliases Robot3_Data[1]
...
...
Data_1[5] aliases Robot6_Data[1]
================================
Data_2[0] aliases Robot1_Data[2]
Data_2[1] aliases Robot2_Data[2]
Data_2[2] aliases Robot3_Data[2]
...
...
Data_2[5] aliases Robot6_Data[2]
Anyone have any wisdom to share? My current options are:
1) Coordinate with the vendor and change tag names (??Likely??)
2) Write 48 "what-ifs" in logic (6 robots x 8 machines)
Thanks for any help you can provide!