Siemens SIMATIC S7-1200 System Manual page 209

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

Advertisement

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
to -1 typically sets ENO = 0 (or FALSE). To evaluate Ret_Val, change the representation
to hexadecimal.
● Status: A value from 16#0000 16#7FFF typically sets ENO = 1 (or TRUE). A value from
16#8000 to 16#FFFF typically sets ENO = 0 (or FALSE).
Instructions that take more than one scan to execute often provide a Busy parameter (Bool)
to signal that the instruction is active but has not completed execution. These instructions
often also provide a Done parameter (Bool) and an Error parameter (Bool). Done signals that
the instruction was completed without error, and Error signals that the instruction was
completed with an error condition.
● When Busy = 1 (or TRUE), ENO = 1 (or TRUE).
● When Done = 1 (or TRUE), ENO = 1 (or TRUE).
● When Error = 1 (or TRUE), ENO = 0 (or FALSE).
See also
OK (Check validity) and NOT_OK (Check invalidity) (Page 252)
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
IN2 := ... ,
OUT1 => #myOut,
ENO => #statusFlag ); // PLC tag statusFlag holds the value of E
IN2 := ... ,
OUT1 => #myOut,
ENO => ENO );
// block status flag of "MyFunction"
// is stored in the local block
// execute code only if MyFunction returns true ENO
Programming concepts
7.5 Programming language
209

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIMATIC S7-1200 and is the answer not in the manual?

Table of Contents

Save PDF