Siemens SINUMERIK 840D sl Programming Manual page 93

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

Advertisement

%.<n>P
Job Planning
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
:
Converting a REAL value into an INTEGER value taking into account <n> decimal
places. The INTEGER value is output as a 32-bit binary number. If the value to be
converted cannot be represented with 32 bits, then processing is interrupted with
an alarm.
As a byte sequence generated using the format instruction
binary zeroes, then the total string that is generated in this way no longer
corresponds to the conventions of the NC data type STRING. As a consequence, it
can neither be saved in a variable, type STRING, nor be further processed using
the string commands of the NC language. The only possible use is to transfer the
parameter to the
(see the following example).
As soon as the <Format_String> contains a format description, type
complete string, with the exception of the binary number generated with
output corresponding to the MD10750 $MN_SPRINT_FORMAT_P_CODE in the
ASCII character code, ISO (DIN6024) or EIA (RS244). If a character that cannot be
converted is programmed, then processing is interrupted with an alarm.
Example:
N10 DEF REAL REAL_VAR=123.45
N20 DEF INT ERROR
N30 DEF STRING[20] EXT_DEVICE="/ext/dev/1"
...
N100 EXTOPEN(ERROR,EXT_DEVICE)
N110 IF ERROR <> 0
...
N200 WRITE(ERROR,EXT_DEVICE,SPRINT("INTEGER BINARY
CODED:%.3P",REAL_VAR)
N210 IF ERROR <> 0
... ; error handling
Result: The string "INTEGER BINARY CODED: 'H0001E23A'" is transferred to the
output device /ext/dev/1. The hexadecimal value 0x0001E23A corresponds to the
decimal value 123450.
command with output at an appropriate external device
WRITE
Flexible NC programming
1.9 String operations
can also contain
%.<n>P
%P
; error handling
then the
, is
%.<n>P
93

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents