EasyManua.ls Logo

Siemens SIMATIC S7-1200 - Page 319

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Basic instructions
8.8 Program control operations
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
319
The CASE statement is executed according to the following rules:
The Test_value expression must return a value of the type Int.
When a CASE statement is processed, the program checks whether the value of the
Test_value expression is contained within a specified list of values. If a match is found,
the statement component assigned to the list is executed.
If no match is found, the program section following ELSE is executed or no statement is
executed if the ELSE branch does not exist.
Example: Nested CASE statements
CASE statements can be nested. Each nested case statement must have an associated
END_CASE statement.
CASE "var1" OF
1 : #var2 := 'A';
2 : #var2 := 'B';
ELSE
CASE "var3" OF
65..90: #var2 := 'UpperCase';
97..122: #var2 := 'LowerCase';
ELSE
#var2:= 'SpecialCharacter';
END_CASE;
END_CASE;

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals