GimmeTheLoot420
Member
Hey,
New to the forum so apologise if I break any rules.
I am trying to write a program insturctured text that will allow me to flash a warning lamp on and off indefinitely until it is manually reset, the lamp is triggered by an alarm signal.
I have tried with what I can so far ut keep getting stuck and cant seem to loop the program back on itself, I can get the lamp to switch on then switch off but not to come back on!
I have seen a few examples on this site of how to do it in ladder logic but I would like to implement it using ST. My attempt so far is below, please any criticsm or help is welcomed! Thank you
PROGRAM _CYCLIC Warning_Lamp;
TON_Warning(IN := Alarm_Active_Flag_1 , PT := T#2s );
IF(TON_Warning.Q = TRUE)THEN
Warning_Lamp := TRUE;
END_IF
TON_Warning_2(IN := TON_Warning.Q , PT := T#2s );
IF(TON_Warning_2.Q = TRUE)THEN
Warning_Lamp := FALSE;
END_IF END_PROGRAM
New to the forum so apologise if I break any rules.
I am trying to write a program insturctured text that will allow me to flash a warning lamp on and off indefinitely until it is manually reset, the lamp is triggered by an alarm signal.
I have tried with what I can so far ut keep getting stuck and cant seem to loop the program back on itself, I can get the lamp to switch on then switch off but not to come back on!
I have seen a few examples on this site of how to do it in ladder logic but I would like to implement it using ST. My attempt so far is below, please any criticsm or help is welcomed! Thank you
PROGRAM _CYCLIC Warning_Lamp;
TON_Warning(IN := Alarm_Active_Flag_1 , PT := T#2s );
IF(TON_Warning.Q = TRUE)THEN
Warning_Lamp := TRUE;
END_IF
TON_Warning_2(IN := TON_Warning.Q , PT := T#2s );
IF(TON_Warning_2.Q = TRUE)THEN
Warning_Lamp := FALSE;
END_IF END_PROGRAM
Last edited: