Hello guys,
I am rather new to KUKA programming. I want to write a WAIT FOR function so that if it's going to take more than a certain time, an Error be declared. Something like this:
WaitLoop1:
$TIMER_STOP[1]=TRUE
$TIMER_FLAG[1]=FALSE
$TIMER[1]=-10000
$TIMER_STOP[1]=FALSE
WAIT FOR ($IN[7] OR $TIMER_FLAG[1])
$TIMER_STOP[1]=TRUE
CONTINUE
IF $TIMER_FLAG[1]== TRUE THEN
MyAlarm(7)
GOTO WaitLoop1
My problem is that, I want to make it as a function or subprogram so that I could easily use it many times in my program. The inputs of this function should be : the IO number (input or output flag)
In fact, I don't want the IO value as input, I want the IO number as input. Not just as a number, but also to recognize if its input or output or a flag.
Can anyone help?