Siemens SINUMERIK 840D sl Programming Manual page 88

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Flexible NC programming
1.9 String operations
Format descriptions available
:
%B
:
%C
:
%D
%<m>D
:
%F
88
Conversion into the "TRUE" string, if the value to be converted:
Is not equal to 0.
Is not an empty string (for string values).
Conversion into the "FALSE" string, if the value to be converted:
Is equal to 0.
Is an empty string.
Example:
N10 DEF BOOL BOOL_VAR=1
N20 DEF STRING[80] RESULT
N30 RESULT=SPRINT("CONTENT OF BOOL_VAR:%B", BOOL_VAR)
Result: The character string "CONTENT OF BOOL_VAR:TRUE" is written to the
RESULT string variable.
Conversion into an ASCII character.
Example:
N10 DEF CHAR CHAR_VAR="X"
N20 DEF STRING[80] RESULT
N30 RESULT=SPRINT("CONTENT OF CHAR_VAR:%C",CHAR_VAR)
Result: The character string "CONTENT OF CHAR_VAR:X is written to the string
variable RESULT.
Conversion into a string with an integer value (INTEGER).
Example:
N10 DEF INT INT_VAR=123
N20 DEF STRING[80] RESULT
N30 RESULT=SPRINT("CONTENT OF INT_VAR:%D",INT_VAR)
Result: The character string "CONTENT OF INT_VAR:123" is written to the string
variable RESULT.
:
Conversion into a string with an integer value (INTEGER). The string has a
minimum length of <m> characters. The missing locations are filled with spaces,
left-justified.
Example:
N10 DEF INT INT_VAR=-123
N20 DEF STRING[80] RESULT
N30 RESULT=SPRINT("CONTENT OF INT_VAR:%6D",INT_VAR)
Result: The character string "CONTENT OF INT_VAR:xx-123" is written to string
variable RESULT ("x" in the example represents spaces).
Conversion into a string with a decimal number with 6 decimal places. Where
relevant, the decimal places are rounded-off or filled with 0.
Example:
N10 DEF REAL REAL_VAR=-1.2341234EX+03
N20 DEF STRING[80] RESULT
N30 RESULT=SPRINT("CONTENT OF REAL_VAR:%F",REAL_VAR)
Result: The character string "CONTENT OF REAL_VAR:-1234.123400" is written
to the string variable RESULT.
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents