beautypg.com

HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 610

background image


01.98

TNC 407/TNC 415/TNC 425

4 PLC Modules

7-149

Examples:

Binary
value

Mode

Before
Dec.

After
Dec.

Dec. Number

123

0

3

0

"123"

123

0

3

2

"1.23"

123

8

3

2

"+1.23"

123

9

3

2

"+ 1.23"

123

10

3

2

" +1.23"

254

0

3

1

"254.0"

254

4

3

1

"10.0"

1000

9

3

3

"+ 1.000"

-1000

9

3

3

"- 1.000"

123456

0

3

0

"456"

4.4.2 Number Conversion ASCII to Binary (Module 9052)

Converts an ASCII coded decimal number (possibly with places after the decimal point) into a
mantissa and an exponent to the base 10.

The string identified by the source string number is read and converted to a signed number and an
exponent to the base 10. If the sign is missing the number is detected as positive. Both the comma
and the point are accepted as the decimal character. If the full extent of the mantissa cannot be
notated in a doubleword then the last places are omitted and the exponent corrected accordingly. If
possible the exponent is adjusted to correspond with the ASCII notation of the number.

Possible errors:
- The number of the source string is outside the valid range (0..3).
- The source string does not contain a string that can be interpreted as a number.
- The string overflows the end of the string buffer, 128 characters were read without an end of

string being found.

Call:

PS

K/B/W/D

CM

9052

PL

B/W/D

PL

B/W/D

Error status after call: M3171 =

0: String was converted
1: Error condition see above