Siemens S7-1200 System Manual page 189

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Configuring SCL to set ENO
To configure the SCL compiler for setting ENO, follow these steps:
1. Select the "Settings" command from the "Options" menu.
2. Expand the "PLC programming" properties and select "SCL (Structured Control
Language)".
3. Select the "Set ENO automatically" option.
Using ENO in program code
You can also use ENO in your program code, for example by assigning ENO to a PLC tag,
or by evaluating ENO in a local block.
Examples:
"MyFunction"
( IN1 := ... ,
NO
"MyFunction"
( IN1 := ...
IF ENO = TRUE THEN
Effect of Ret_Val or Status parameters on ENO
Some instructions, such as the communication instructions or the string conversion
instructions, provide an output parameter that contains information about the processing of
the instruction. For example, some instructions provide a Ret_Val (return value) parameter,
which is typically an Int data type that contains status information in a range from -32768 to
+32767. Other instructions provide a Status parameter, which is typically a Word data type
that stores status information in a range of hexadecimal values from 16#0000 to 16#FFFF.
The numerical value stored in a Ret_Val or a Status parameter determines the state of ENO
for that instruction.
● Ret_Val: A value from 0 to 32767 typically sets ENO = 1 (or TRUE). A value from -32768
● Status: A value from 16#0000 16#7FFF typically sets ENO = 1 (or TRUE). A value from
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
IN2 := ... ,
OUT1 => #myOut,
ENO => #statusFlag ); // PLC tag statusFlag holds the value of E
IN2 := ... ,
OUT1 => #myOut,
ENO => ENO );
// execute code only if MyFunction returns true ENO
to -1 typically sets ENO = 0 (or FALSE). To evaluate Ret_Val, change the representation
to hexadecimal.
16#8000 to 16#FFFF typically sets ENO = 0 (or FALSE).
// block status flag of "MyFunction"
// is stored in the local block
Programming concepts
6.5 Programming language
189

Advertisement

Table of Contents
loading

Table of Contents