I'm struggling with an assignment I was given about PLC programming. The set up is the following:
When the alarm signal (= input) is set, a lamp (=output) begins to flash at a frequency of 1Hz and the klaxon (=output) is activated. From the moment a person pushes the acknowledge button (=input), the klaxon stops functioning. Depending on the state of the alarm while acknowledging, the lamp changes from flashing to fully on until the alarm is reset. An overview of the behavior of both outputs, based on the inputs is given in the following figure
Is there anyone that is familiar with this kind of task? I would really appreciate the help. Thanks in advance!
This is what I have so far:
// if alarm goes of, the klaxon and an alternating light start
IF gvl.IN_alarm := TRUE THEN
gvl.OUT_klaxon := TRUE;
//alternating signal
FB_ton(IN:= NOT qton1 , PT:= T#1S, Q=> qton1 );
FB_pulse(IN:= qton1 , PT:= T#1S , Q=> gvl.OUT_flashingLight);
END_IF
// if button is pressed, the klaxon goes off and the light becomes fully on
IF gvl.IN_acknowledge := TRUE THEN
gvl.OUT_klaxon := FALSE;
gvl.OUT_flashingLight := TRUE;
END_IF
// if the alarm is reset, the light goes out
IF gvl.IN_alarm := FALSE THEN
gvl.OUT_flashingLight := FALSE;
END_IF