Detect rising edge in RAPID

I come from the world of PLC programming, where rising and falling edge detection is crucial in a lot of programs, but I can't figure out how to make it work in ABB RAPID.
What I want to do, is change the function of a physical button to a switch, so that when the button is pressed, a bit is reversed ( 0 -> 1, 1 -> 0), and it makes the most sense to me do to that via rising edge detection.

Scenario:
We're using zero-point clamping modules on an IRBP B250, and to open and close the modules, we use airpressure which is controlled by the robot controller. For safety, we've installed a button thats supposed to turn the air on and off, releasing and locking the clamping modules.

Comments

  • MickyMicky Germany ✭✭✭
    Hello BigApe,
    You could use an interrupt with ISignalDI to detect the rising edge and execute the necessary functionality in the associated TRAP routine. Since the interrupt is only executed when the program is running, you have to check if the detection is also necessary when the program is stopped and implement the detection of the rising edge by a separate semi-static task (multitasking). 
  • BigApeBigApe Denmark
    Micky said:
    Hello BigApe,
    You could use an interrupt with ISignalDI to detect the rising edge and execute the necessary functionality in the associated TRAP routine. Since the interrupt is only executed when the program is running, you have to check if the detection is also necessary when the program is stopped and implement the detection of the rising edge by a separate semi-static task (multitasking). 
    Thank you, I'll try this.

    It'll be neccessary both while started and stopped, which is why I have already put the test code in its own task. 
Sign In or Register to comment.