Lenze DDS v2.3 Manuel d'utilisateur Page 45

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 340
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 44
Drive PLC Developer Studio
Programming languages
4-7
l DDS EN 2.3
Example:
IF temp < 17 THEN
heating_on:=TRUE;
ELSE
heating_on:=FALSE;
END_IF;
In this example the heating is switched on only if the temperature falls below 17 degrees Centigrade,
otherwise the heating will remain off.
4.3.8 CASE instruction
Use the CASE instruction to aggregate several conditional instructions with the same conditional
variable.
Syntax:
CASE <Var1> OF
<Value 1>:<instruction 1>
<Value 2>:<instruction 2>
...
<Value n>:<instruction n>
ELSE
<ELSE instruction>
END_CASE;
A CASE instruction is processed as described below:
Ifthevariablein<Var1> is set to <Value i>, the instruction <instruction i> will be
executed.
If <Var 1> does not equal one of the specified values, the <ELSE instruction> will be
executed.
If the same instruction is to be executed for several variable values, these values can be
comma-separated to indicate that they are linked to the same instruction.
If the same instruction is to be executed for a value aggregate of the variable, the start and
end values can be separated by two successive periods to indicate that they are linked to the
same instruction.
Example:
CASE INT1 OF
1,5:BOOL1:=TRUE;
BOOL3:=FALSE;
2:BOOL2:=FALSE;
BOOL3:=TRUE;
10..20:BOOL1:=TRUE;
BOOL3:=TRUE;
ELSE
BOOL1:=NOT BOOL1;
BOOL2:=BOOL1 OR BOOL2;
END_CASE;
Show/Hide Bookmarks
Vue de la page 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 339 340

Commentaires sur ces manuels

Pas de commentaire