beautypg.com

HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual

Page 611

background image


7-150

TNC 407/TNC 415/TNC 425

4 PLC Modules

01.98

4.4.4 Conversion Binary to ASCII/Hexadecimal (Module 9053)

Converts a block of binary values from the word marker range into a string of ASCII coded
hexadecimal numbers.

The specified number of bytes is read from the place specified by the source address and converted
to a hexadecimal-coded ASCII string. Each byte in the source block makes 2 characters in the
destination string. the destination string is identified by the destination string number.

Possible errors:
- The address for the source block is outside the range 0 to 1023.
- The number of the destination string is outside the valid range (0..3).

Call:

PS

K/B/W/D

PS

K/B/W/D

PS

K/B/W/D

CM

9053

Example:

0110 0011

B0 = 99

6

S0 = Hex 63

3

Error status after call: M3171 =

0: String was converted
1: Error condition see above

4.4.5 Conversion ASCII/Hexadecimal to Binary (Module 9054)

Converts a string of ASCII coded hexadecimal values to a block of binary values in the word marker
range.

The string in the string buffer with the specified number is interpreted as a chain of ASCII coded
hexadecimal numbers and converted into a block of corresponding binary bytes. Two ASCII
characters make one binary byte. The binary block is stored in the word marker range starting from
the specified destination address.

Possible errors:
- The number of the source string is outside the permitted range (0..3).
- The address for the destination block is outside the range 0 to 1023.
- The source string contains characters that cannot be interpreted as hexadecimal values (different

characters 0..9, A..F).

- The source string contains an uneven number of characters (the last byte is not fully defined).
- The destination block has no room at the specified address.