January 2012 8.41 PLC Modules 1757
Module 9052 Conversion of decimal string → Decimal number with an
exponent
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. If the
number has no algebraic sign, the control 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 control
adjusts the exponent so that it corresponds to the ASCII notation.
Call:
PS B/W/D/K <String address in which the ASCII-coded decimal number
is saved>
CM 9052
PL B/W/D <Numerical value>
PL B/W/D <Exponent to the base of 10 of the 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 control 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 two
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 control saves the hexadecimal
numbers>
PS B/W/D/K <Number of data bytes>
CM 9053
Error recognition:
Marker Value Meaning
NN_GenApiModuleErr
or (M4203)
0 Number was converted
1 For error code see NN_GenApiModuleErrorCode
(W1022)
NN_GenApiModuleErr
orCode (W1022)
2 Invalid string address or string contains none or
too many characters
Marker Value Meaning
NN_GenApiModule
Error (M4203)
0 Number was converted
1 For error code see
NN_GenApiModuleErrorCode (W1022)
NN_GenApiModule
ErrorCode (W1022)
1 Too many data bytes
2 Invalid string address
4 Invalid word address