Issue with while loop for robot program

Im doing a Pick & Place robot for a school project including communication with a Siemens PLC, and the connectivity works fine.
Im trying to create a while loop for the Kuka robot, however it does not enter the while loop even if $OUT[20] is true. If i manage the enter the loop, the rest of the code works just fine.
Any suggestions why the program does not enter the while loop. Is the syntax wrong?

I don’t know about the KUKA KRL programming, but using value of an output in program logic like that sounds weird in general. Could you use a variable or input instead?

That was also my initial thought, however after seeing some guides on youtube with people programming Other robot’s they also use the in- and outputs.

TSy you suggestion was correct, I can only initiate a while loop with an input.
Problem is solved, thanks for your contribution.

1 Like