beautypg.com

HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 609

background image


7-148

TNC 407/TNC 415/TNC 425

4 PLC Modules

01.98

4.4.2 Number Conversion Binary to ASCII (Module 9051)

Converts a binary numerical value to an ASCII-coded decimal number in the format specified.

The specified number is converted to a decimal number and stored as a string in the specified
address.
The number is notated as a two's complement. When notated without a sign the absolute amount
of the number is converted without a sign being put before the string. With the signed notation a
sign ("+" or "-") is placed before the string in any event.
With the inch notation the numerical value is divided by 25.4 before being converted. If the number
has more decimal places than the total of specified places before and after the decimal point, then
the highest-value decimal places are omitted. With right-justified notation leading zeroes before the
decimal point are replaced by blanks, with left-justified notation they are suppressed. Trailing zeroes
after the decimal point are always converted.

Constraints:
- The decimal sign is defined by machine parameter MP7280 as a decimal comma (MP7280 = 0) or

a decimal point (MP7280 = 1).

Possible errors:
- The number of the target string is outside the permitted range (0..3).
- There are more than 16 decimal places in all (before and after decimal point).
- No places before the decimal point are specified.

Call:

PS

K/B/W/D

PS

K/B/W/D


Bit #3: display with sign
Bit #2: display converted to INCH
Bit #1/#0: Format
00: Sign and number left-justified
1: Sign left-justified, number right-justified
10: Sign and number right-justified
11: Not permitted

PS

K/B/W/D

PS

K/B/W/D

PS

K/B/W/D

CM

9051

Error status after call: M3171 =

0: Number was converted
1: Error condition see above