@MarvinW's code only works if DebounceTime is T#0S. Otherwise WaitIo/WaitBool returns "OK" for only once cycle and restarts the debounce timer and probably both sensors will not reach the setpoint state at the exactly same time. That means WaitIo/WaitBool in combination with a debounce time can only be used with a direct assignment _retVal:=WaitIo(...) or _retVal:=WaitBool(). This is the "problem" of the original post by tommy3000.
An alternative solution would be creating a BinIo flag with WaitIo:
_retVal := WaitIo(CallIdx := 1, iBinIo := BinIo, IoIdx := BinIo._120MB60xA, // BinIo flag with _120MB60xA := _120MB601A AND _120MB602A SetpointState := TRUE, DebounceTime := T#100MS, Timeout := T#5S, AutoClear := TRUE/FALSE, EventClass := OpconEventClass.SOFTERROR);
... View more