I'm trying to understand how the PLC will scan this "For" loop.
will the "PhoneNb" variable not increment until all instructions within the "For" - "End_For" are complete? Or how will it scan this? Ton_4 is 3 seconds and Ton_5 & 6 are 1 second timers.
if FBEN THEN
For PhoneNb := 1 to 2 DO
TON_4(AWT_4.Q, Time2); R_TRIG_8(TON_4.Q); AWT_4(R_TRIG_8.Q, TextModeEnable, EnableTextMode);
TON_5(AWT_5.Q, Time1); R_TRIG_9(TON_5.Q); AWT_5(R_TRIG_9.Q, PhoneChannel, PhoneNumber[PhoneNb]);
TON_6(AWT_6.Q, Time1); R_TRIG_10(TON_6.Q); AWT_6(R_TRIG_10.Q, TxtMessage, TxtMessageData[EvtMsg]);
END_FOR;
SendDone := TRUE; (* Function Block Done Bit *)
END_IF;
will the "PhoneNb" variable not increment until all instructions within the "For" - "End_For" are complete? Or how will it scan this? Ton_4 is 3 seconds and Ton_5 & 6 are 1 second timers.
if FBEN THEN
For PhoneNb := 1 to 2 DO
TON_4(AWT_4.Q, Time2); R_TRIG_8(TON_4.Q); AWT_4(R_TRIG_8.Q, TextModeEnable, EnableTextMode);
TON_5(AWT_5.Q, Time1); R_TRIG_9(TON_5.Q); AWT_5(R_TRIG_9.Q, PhoneChannel, PhoneNumber[PhoneNb]);
TON_6(AWT_6.Q, Time1); R_TRIG_10(TON_6.Q); AWT_6(R_TRIG_10.Q, TxtMessage, TxtMessageData[EvtMsg]);
END_FOR;
SendDone := TRUE; (* Function Block Done Bit *)
END_IF;