101BExtended instructions
8.2 String and character
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
253
Table 8- 48 Examples of hexadecimal -to- ASCII (HTA) conversion
IN value
N
OUT character bytes
ENO (ENO always TRUE after HTA execution)
W#16#0123
2
'0123'
TRUE
DW#16#123AF012
4
'123AF012'
TRUE
Table 8- 49 ATH and HTA condition codes
RET_VAL
(W#16#....)
Description
ENO
0000
No error
TRUE
0007
Invalid ATH input character: A character was found that was not an ASCII character 0-
9, lowercase a-f, or uppercase A-F
FALSE
8101
Illegal or invalid input pointer, for example, an access to a DB that does not exist.
FALSE
8120
Input string is an invalid format, i.e., max= 0, max=255, current>max, or grant length in
pointer < max
FALSE
8182
Input buffer is too small for N
FALSE
8151
Data type not allowed for input buffer
FALSE
8301
Illegal or invalid output pointer, for example, an access to a DB that does not exist.
FALSE
8320
Output string is an invalid format, i.e., max= 0, max=255, current>max, or grant length
in pointer < max
FALSE
8382
Output buffer is too small for N
FALSE
8351
Data type not allowed for output buffer
FALSE
8.2.4
String operation instructions
Your control program can use the following string and character instructions to create
messages for operator display and process logs.
8.2.4.1
LEN
Table 8- 50 Length instruction
LAD / FBD
SCL
Description
out := LEN(in);
LEN (length) provides the current length of the string IN at output OUT. An
empty string has a length of zero.