CoDeSys
Siemens S7-1200 viide Siemens LOGO! viide Automatiseerimise viide Mehhatroonikaseadmete viide Pneumoautomaatika viide
Joonis
Joonis

7.2 Ülesanne: Massiivi liikmetele väärtuste omistamine

Juhtpaneeli kirjeldus

Juhtpaneelil on 3 nuppu (S1 - Start, S2 - Stop, S4 - Reset), üks võtmega lüliti (S3 - Auto/Man) ja 4 indikaatorlampi (H1, H2, H3, H4).

Ülesande püstitus

Koostada programm, kus START nupu vajutusega omistatakse 3-liikmelise massiivi (array) esimesele liikmele väärtus 6, teisele liikmele väärtus 123 ning kolmandale liikmele väärtus 234.

STOP nuppu vajutades tuleb kõigile kolmele massiivi liikmele omistada väärtus 0.

Massiiv ei ole seotud ühegi füüsilise väljundiga. Ülesande korrektset täitmist kontrollitakse Login vaates massiivi liikmete väärtusi jälgides.


Soovitatav lugemismaterjal

Ülesande lahendamiseks tutvuda järgmiste peatükkidega.

7.2 Exercise: Adding values to the array elements

Description of the control panel

The control panel has three buttons (S1 – Start button, S2 – Stop button, S4 – Reset button), one key switch (S3 – Auto/Man (in normal state, it is on Auto)) and 4 indicator lights (lamps) (H1 – Start light, H2 – Reset light, H3 – Light Q1, H4 – Light Q2).

Description of the exercise

Write a program that assigns new values to a 3-member array when pressing START button. The first array member gets value of 6, the second member value of 123, and the third member value of 234.

All array members get value 0 when the STOP button is pressed.

The array is not associated with any PLC physical outputs. The correct execution of the program is controlled in Login view by watching the array values.

Creative Commons Licence
"CoDeSys" is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License .