The robot picks and places some plastic stuff inside the holes of a turntable, just like a revolver.
In the master job there's a WHILE that keeps checking different signals so the robot can make a different subtask based on them. The cycle time here is TIGHT, so the robot has to make whatever it needs whenever it gets a signal to do so. This is the cause.
One subtask manages the servomotor, sending a pulse. Whenever the servo finishes turning I need to increment a variable. Since I have to keep going with the rest of the cycle I can't wait for that. Instead, there's a WAIT IN#(SERVO INPOS) in every subtask. But they may not be executed. So, right now, I'm incrementing the variable with each pulse, leading to errors.
I need something that is constantly checking, like PLC ladder. But the controller's own ladder editor doesn't let me touch variables. Can I use this? This controller does not have the system/parallel job function.
I thought of maybe waiting for the servo input before sending the pulse, but - I confirmed this - the robot controller can cycle faster than the PLC turns the input off. So there's times when the robot sends a signal twice (and increments twice) before the disk hasn't even begin moving. I programmed a timer that stops the robot from executing that subtask if it goes too fast, but it's kind of a half assed solution and doesn't work flawlessly either.
I could also make it work if the controller let me turn off that input by myself before sending the pulse. Is this possible? This way I wouldn't need to synchronize the controller and the PLC.
Thanks