7 – 182 HEIDENHAIN Technical Manual TNC 426, TNC 430
Module 9052 Conversion of ASCII numbers → binary
Module 9052 converts an ASCII-coded decimal number (possibly with decimal
places) into a signed number and an exponent to the base of 10. You must
assign the ASCII-coded decimal number to one of the string memories S0 to
S15. If the number has no algebraic sign, the TNC interprets it as a positive
number and accepts both a point and a comma as decimal character. If the full
extent of the mantissa cannot be represented in a double word, then the last
places are omitted and the exponent is corrected accordingly. If possible, the
TNC adjusts the exponent so that it corresponds to the ASCII notation.
Call:
PS B/W/D/K <String address in which the TNC saves the ASCII-coded
decimal number>
CM 9052
PL B/W/D <Numerical value>
PL B/W/D <Exponent to the base of 10 of a value>
Error recognition:
Module 9053 Conversion from binary → ASCII/hexadecimal
Module 9053 converts blocks of binary values from the word-marker range
into a string of ASCII-coded hexadecimal numbers. The TNC reads the
specified number of bytes from the word address that you have specified and
converts it to a hexadecimally coded ASCII string. Each byte produces 2
characters in the string memory.
Call:
PS B/W/D/K <Word address from which the binary values are saved>
PS B/W/D/K <String address in which the TNC saves the hexadecimal
numbers>
PS B/W/D/K <Number of data bytes>
CM 9053
Error recognition:
Marker Value Meaning
M4203 0 Number was converted
1 For error see W1022
W1022 2 Invalid string address or string contains none or too many
characters
Marker Value Meaning
M4203 0 Number was converted
1 For error see W1022
W1022 1 Too many data bytes
2 Invalid string address
4 Invalid word address