1756 HEIDENHAIN Technical Manual MANUALplus 620
Module 9051 Conversion from binary → ASCII
Module 9051 converts a binary numerical value into an ASCII-coded decimal 
number in the specified format and saves it as a string in the specified 
address. The number is interpreted as a two’s complement. For algebraically 
unsigned notation, the control converts the absolute amount of the number 
without putting a sign before the string. For algebraically signed notation, the 
control sets an algebraic sign ("+" or "–") in front of the string in any event. For 
notation in inches, the number is divided by 25.4 before conversion. If the 
number has more decimal places than the total that you have specified for the 
number of places before and after the decimal point, then the control omits 
the most highly significant decimal places. In right-aligned notation leading 
zeros before the decimal point are replaced by blanks; in left-aligned notation 
they are suppressed. Trailing zeroes after the decimal point are always 
converted.
Constraints: 
The decimal character is defined by Machine Parameter MP7280 as a comma 
(MP7280 = 0) or a period (MP7280 = 1).
Call:
PS B/W/D/K <Numerical value to be converted>
PS B/W/D/K <Display modes, bit-encoded>
Bit #1/#0: Format
00: Sign and number left-aligned
1: Sign left-aligned, number right-aligned
10: Sign and number right-aligned
11: Not permitted
Bit #2: Display converted to INCH
Bit #3: Display with sign
PS B/W/D/K <Number of places after the decimal point>
PS B/W/D/K <Number of places before the decimal point>
PS B/W/D/K <String address in which the control saves the ASCII-coded 
decimal number>
CM 9051
Error recognition: 
Marker Value Meaning
NN_GenApiModule
Error (M4203)
0 Number was converted
1 Error code in NN_GenApiModuleErrorCode 
(W1022)
NN_GenApiModule
ErrorCode (W1022)
2 Invalid string address, invalid display mode 
or invalid number of places before or after 
the decimal point