Siemens SIMATIC S7 System Manual page 235

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Note
The following conditions cause a non-fatal error, set power flow to OFF (ENO bit = 0), and
use value 0 as the result of the comparison:
• Illegal indirect address is encountered (any compare instruction)
• A variable string with a length greater than 254 characters is encountered (Compare
String instruction)
• A variable string whose starting address and length are such that it will not fit in the
specified memory area (Compare String instruction)
To prevent these conditions from occurring, ensure that you properly initialize pointers and
memory locations that are intended to hold ASCII strings prior to executing compare
instructions that use these values. Ensure that the buffer reserved for an ASCII string can
reside completely within the specified memory area.
Compare instructions are executed regardless of the state of power flow.
Input / output
Data type
IN1
STRING
IN2
STRING
OUT
BOOL
Format of the STRING data type
A string variable is a sequence of characters, with each character stored as a byte. The first
byte of the STRING data type defines the length of the string, which is the number of
character bytes.
The diagram below shows the STRING data type stored as a variable in memory. The string
can have a length of 0 to 254 characters. The maximum storage requirement for a variable
string is 255 bytes (the length byte plus 254 characters).
If a constant string parameter is entered directly in the program editor (126 characters
maximum) or a variable string is initialized in the data block editor (254 characters
maximum), the string assignment must begin and end with double quote characters.
See also Constants (Page 83)
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
Operand
VB, LB, *VD, *LD, *AC, Constant string
VB, LB, *VD, *LD, *AC
LAD: Power flow
FBD: I, Q, V, M, SM, S, T, C, L, Logic Flow
Program instructions
7.4 Compare
235

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents