6.3 Ülesanne: Muutuva ajaga ühe lambi töötamine
Süsteemi „Nuppud ja lambid” kirjeldus
Süsteemus on 3 nuppu (S1 - Start, S2 - Stop, S3 - Reset) ja 3 indikaatorlampi (H1 - roheline, H2 - kollane, H3 - punane).
Ülesande püstitus
Koostada programm, mis pärast START nupu vajutust lülitab valgustorni indikaatorlambi H1 sisse 2 sekundiks. Igal järgmisel START nupu vajutamisel pikeneb indikaatorlambi H1 töötamise aeg 1 sekundi võrra. Seda ainult siis kui indikaatorlamp H1 ei tööta.
Pärast RESET nupu vajutamist peab indikaatorlamp H1 töötama järgmisel START nupu vajutamisel 2 sekundit. Ülejäänud toimub nii nagu kirjeldatud eespool.
Lülitamine peab olema korratav. Nuppude allhoidmisel ei tohi esineda vilkumist ega mitmekordset aja loendamist.
Soovitatav lugemismaterjal
Ülesande lahendamiseks tutvuda järgmiste peatükkidega.
CoDeSys animatsioon
Alla laetav animatsioon virtuaalsele PLC-le "CODESYS Control WIN V3". See võimaldab testida PLC programmi arvutis ilma reaalse riistvarata.
6.3 Exercise: A light with variable working time
Description of the buttons and lights
The MFS stand has three buttons (S1 – Start button, S2 – Stop button, S4 – Reset button) and 3 indicator lights (lamps) (H1 – Green light, H2 – Yellow light, H3 – Red light).
Description of the exercise
Write a program that switches the indicator light H1 on for 2 seconds when pressing the START button. Next START button pressing is extending the light H1 working time by 1 second. The working time of the light H1 is increasing when it has not been switched on.
The working time of the light H1 is reset when the RESET button is pressed.
The switching must be repeatable. There should be no flashing of the lights or double counting of the time when holding the buttons.
CoDeSys animation
Animation for virtual PLC "CODESYS Control WIN V3". Download it and solve the exercise on the PC without the real equipment.