Siemens SINUMERIK 840D sl Programming Manual page 456

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Work preparation
3.1 Flexible NC programming
Format descriptions available
%B:
%C:
%D:
%<m>D:
%F:
456
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 rele‐
vant, 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 string variable RESULT is written with the character string "CONTENT
OF REAL_VAR: -1234.123400".
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents