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

7.3 Ülesanne: Massiivi liikmete valimine ja suurendamine

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 saab valida, mitmendat 4 liikmelise massiivi (array) liiget suurendama hakatakse ning RESET nupu vajutus suurendab valitud liikme väärtust 1 võrra.

Liikmete valimine peab olema korratav.

Ühe massiivi liikme väärtus ei tohi olla suurendatav üle kasutatava muutuja andmetüübi maksimaalse väärtuse.

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.3 Exercise: Selecting an array member and increasing its value

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 where START button selects from 4-member array a member and RESET button increases its value by 1.

The array member selection must be repeatable.

The value of an array member must not be increased over the allowed maximum value. The maximum value is given by the data type used in the array declaration.

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 .