Hi there, I'm quite new with kuka programming, forgive me if I'm asking for too simple issue.
I'm having trouble understanding an approach to a Cyclic Flag and WAITFOR instruction in offline program I'm reworking.
Is there any possible reason programmers keep using $IN instead of just assigned $CYCFLAG in WAITFOR/IF statements?
Compare those two parts of the code, would the second one work identical?
Cyclic flag usage with WAIT FOR instruction
-
saikomiki -
May 10, 2025 at 12:43 PM -
Thread is Resolved
-
-
MOM
May 10, 2025 at 1:43 PM Approved the thread. -
IIRC, the message would be different, but the effect should be the same. This is, the message would say "Waiting for $CYCFLAG[2]" instead of $IN[97].
$CYCFLAG[2]=$IN[97]
WAIT FOR ( $IN[97] OR $TIMER_FLAG[1] )
WAIT FOR ( $CYCFLAG[2] OR $TIMER_FLAG[1] )Generally no one bothers with $CYCFLAGs because there's nothing really to be gained from using them, outside of certain specific situations. The first one I can thing of is Interrupts -- Interrupts do not support Boolean Algebra, so if you want an Interrupt to trigger on a complex signal combination, using something like $CYCFLAG[1]=($IN[1] AND ($IN[2] OR NOT $IN[3]) AND ($IN[4] EXOR $IN[5]), you can do that and then have the Interrupt triggerd by the $CYCFLAG.
The automatically generated WAIT FOR messages are convenient, but simplistic. When I got into complex wait situations, I got into the habit of simply using a REPEAT loop with my own Status message, and erasing the message upon the Loop exit.
-
Thanks, It didn't cross my mind that this could affect messages, I guess in my case that's the reason ($IN[x] is easier to understand for maintenance guys).