Instructions; Selection Instructions - JUMO LOGOSCREEN 601 Manual

Paperless recorder, st editor
Hide thumbs Also See for LOGOSCREEN 601:
Table of Contents

Advertisement

7

Instructions

The ST module supports the following types of instructions:
Selection instructions (IF, CASE)
Repeat instructions (FOR, WHILE, REPEAT)
7.1

Selection instructions

A selection instruction executes an instruction or group of instructions based on a specified condition.
IF instruction
The IF instruction specifies that a group of instructions is only executed if the corresponding Boolean
expression returns the value TRUE. If the condition is incorrect, either no instruction may be executed
or the instruction group following the keyword ELSE (or the keyword ELSIF, if its associated Boolean
condition is true) must be executed.
Keywords:
IF, THEN, ELSIF, ELSE, END_IF
Example:
VAR
i : UINT;
END_VAR
IF reset_flag THEN
bool_out01 := FALSE;
bool_out02 := FALSE;
i := 1;
END_IF;
(* after the reset, the outputs bool_out01 and bool_out02 are reset first and i is set
to 1 *)
IF i>0 AND i<=100 THEN
bool_out01 := TRUE;
bool_out02 := FALSE;
ELSIF i>100 AND i<=200 THEN
bool_out01 := FALSE;
bool_out02 := FALSE;
ELSE
i := 1;
bool_out01 := FALSE;
bool_out02 := FALSE;
END_IF;
(* in cycle 1 to 100 the output bool_out01 is set and bool_out02 is reset *)
(* in cycle 101 to 200 the output bool_out01 is reset and bool_out02 is set *)
(* in cycle 201 i is set to 1 and the outputs bool_out01 and bool_out02 are reset; the
whole thing starts again *)
i := i + 1;
(* i is increased by 1 *)
7 Instructions
31

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Logoscreen 700706521706530

Table of Contents