Display MoreHi,
Not really sure what you mean with your description after your example code...
Do you want the robot to MOVE to a HOME position? Then why do it with a macro program?I would suspect the work-flow to be something like this:
Wait for order from PLC (which bay should the robot go to?) -> move to correct bay -> perform scanning program at the correct bay -> move back to HOME ->Eat, sleep, repeat.
Am I correct?
Depending on how it looks, you could make a program that moves the robot to the Home position in a safe manner, regardless of which bay it was working on.
Also, in your example code, the first 4 instructions are redundant. No matter what value GI[4] has, it will always be written to R[5] (so no need to reset it to 0 before). Also, the 7th element of PR[1], PR[2] and PR[99] will be either 1000 or 2000 (either GI[4] is 2, and then the 7th elemtent will be 2000, or GI[4] is something else and the 7th element will be 1000).
Also, you specify an offset condition, but don't use the offset command in the motion instruction?
Hey dude,
Sorry, don’t mean to bombard you with replies but I think I have an answer. In the program below I made some changes mainly I explicitly right the 7th axis value to the $REFPOS1[1].$PERCHPOS[7] variable in the AxisOffset program which is called at the beginning of the style.
I’m going to make additional changes after lunch by like the PR’s and the variable to R[490] because I couldn’t make the variable relative to the Group input but I can make it relative to a register.
The program I’m posting is just a rough sketch, as I mentioned I’m going to link everything to R[490] which itself is relative to the group input so I don’t have to explicitly 0 out my PR’s as you mentioned.
Thanks for the help!