I have made a thread to monitor an input.
If my air-vise doesn’t clamp it over-travels tripping the sensor.
Within the main program I have a wait command that looks for Vise_sensor = low before proceeding. If the vise_sensor is tripped it should pause and not proceed with main program.
If the input goes high, I want to turn on an Alarm output.
I am using an IF Vise_sensor = True
then Set Vise_Alarm to high
Is this the correct way to monitor an output in a thread
I run the program and trip the sensor and I don’t get the alarm output.
I had set a manual line number pause in the program.
This was so I could flag the sensor and not really run any robot move; just test sensor & alarm.
I think that pops the robot controller out of Program running.
I inserted a 600s wait instead, to allow me time to trip the sensor without actually running any robot moves.
during that wait time, I tripped the sensor and the alarm output went high.
All good, and another small nugget of knowledge to know while debugging.
You’re correct. In the future, I like to just say “wait for digital output [SOMETHING] to go high” and just pick a digital output that isn’t being used. That lets you then just go to the teach pendent and manually turn that output on to advance your program if you want.
So I’m going to make an input on my controller “Hold-Stop” and use it in strategic locations.
If you familiar with CNC machines, there is a G-Code M01 called a program stop.
There is a button on the controller called “OPTION STOP” to toggle it on and off.
This concept would work much like that.
If i turn on the input before I run the robot it will run right through the “Hold-Stop” points.
If it’s not manually turned on, the program would stop at the strategic points.
Sure. But make sure it’s an OUTPUT as you can’t manually toggle inputs unless you’re in simulation mode, or use external hardware. It seems counter-intuitive, I know, but you can check the state of outputs just as easily.
The configurable IO can be used exactly like the digital outputs. They just have the ADDED option of being used as dual channel OSSD inputs/outputs for safety devices. These get configured in pairs through the “Safety IO” tab in the Installation screen. If you don’t need any of those safety functions, you’re free to use all of them as if they were digital IO.
It’s also worth noting that the UR can be a MODBUS server, so if you’re using IO permanently for this type of “HOLD” debugging concept, consider enabling that and just using a MODBUS signal. You can toggle those on/off manually as well.