I found this in one of our projects. It is from real machine, which normally runs, so it should be ok. Maybe the clue for your problem is additional empty step 2. Object probably needs one PLC scan to process something inside of it. What I do not understand is, why timeout is not implemented in step 1. CASE _step OF
0: // Start command
IF ( Scanner1.Unit.ExecState = OpconExecState.READY )
THEN
Scanner1.Unit.Command := ScannerCmd.READ;
Scanner1.Unit.Execute := TRUE;
_step := _step + 1;
END_IF
1: // Wait until finished
IF ( Scanner1.Unit.ExecState <> OpconExecState.RUNNING )
THEN
Scanner1.Unit.Execute := FALSE;
_step := _step + 1;
END_IF
2: // End step
_step := 0;
ELSE
Scanner1.Unit.Execute := FALSE;
_step := 0;
END_CASE
... View more