Hi, I'm using a kuka robot with phoenix interbus for signal input and output 24V version. Regarding program. I only wanna cycle a program once for each part.
What I want to achieve here with buttons is to not put a sensor underneath the device that holds the workpiece that needs to be deburr. There is too much dust and I want to press a button to each corresponding devices in the robot workspace to initiate the program. The program runs only once for each workpiece (multiple presses=multiple runs!).
The stupid simple commands that i want to achive are:
---
LOOP
IF $IN[6]==TRUE THEN;
PROG_NO=1; program_1 is executed
IF $IN[7]==TRUE THEN;
PROG_NO=2; program 2 is executed
ENDLOOP
END
---
I have another 10 inputs free from the robot to make this test. For the moment I want to try a simple 2 inputs for 2 workpieces that already have a green button.
My problem is with the code!. These signals I have just like the real thing
DEF MAIN()
DECL INT Cycle
SIGNAL PROG_CYCLES $IN[6] TO $IN[7] ; 4-bit code (6-7 to be used for test)
SIGNAL START_BUTTON $IN[2] ;
LOOP ; run forever
WAIT FOR $IN[6] ; workpiece 1, buttom press
WAIT FOR START_BUTTON ; wait for button press
FOR Cycle = 1 TO PROG_CYCLES ; do 1-15 cycles as selected
SWITCH PROG_CHOICE
CASE 1 ;if PROG_NO=1
PART_1A()
CASE 2 ;if PROG_NO=2
PART_2A()
PART_2B()
ENDSWITCH
ENDFOR
ENDLOOP
END