Does someone help me with the code?

Eventually, once I enter CASE 0, I wait for 3 conditions to be met, otherwise, after 5 seconds, the error manager of the “MaxTime” instruction starts. But to include “TimeFlag” (line 15 and 25), to differentiate (what I want to write as TPWrite, lines 36 and 40) the CASE 0 of CASE 1, the cursor passes by the “SearchPallet” procedure in the first one “defValue” in the second case, not respecting that the “WaitUntil” condition is fulfilled when retrying with “RETRY”.

Something I’m doing wrong? I appreciate your comments …

Hello,
Your WaitUntil will not trig error if you pass TimerFlag.
You have to test it after WaitUntil.

[\TimeFlag]

Timeout Flag

Data type: bool

The output parameter that contains the value TRUE if the maximum permitted waiting time runs out before the condition is met. If this parameter is included in the instruction then it is not considered to be an error if the max. time runs out. This argument is ignored if the MaxTime argument is not included in the instruction.

Any idea of how to differentiate the text from “TPWrite” using the same error handler without actually putting the variable manually before “WaitUntil” and thus using IF conditions, or maybe 2 error handlers are possible? "

Yep - “nRecipe=0” instead of the “flagSearch” bool…