Call 27: basic floating point to 4- digit bcd, Call 27: basic floating point to 4-digit bcd – Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 207

Chapter
Call Routines 0–68
12
12 -17
Use this routine to convert a variable in BASIC floating point format to a
signed, 6-digit, fixed decimal point PLC number and store it in 2 words in
the block-transfer-read buffer. See also CALL 39.
See Chapter 8 for more information.
Input and Output Arguments
This routine has two input arguments and no output arguments. The first
input value is the data (+999.999) or variable you want to convert to
3.3-digit, signed BCD. The second input value is the number of the first
word (1–64) to receive the converted value in the BTR buffer. The sign bit
number is bit 16.
Syntax
PUSH
value to be converted
PUSH
word number (1–64) of BASIC module BTR buffer
CALL 26
Example
>50 PUSH S
:REM VALUE TO BE CONVERTED
>60 PUSH 3
:REM WORD 3 IN THE BTR BUFFER GETS THE VALUES
>70 CALL 26
:REM DO THE CONVERSION
Use this routine to convert a value in BASIC floating point format to a
4-digit, unsigned BCD PLC value and place it in the block-transfer-read
buffer. See also CALL 17.
See Chapter 8 for more information.
Input and Output Arguments
This routine has two input and no output arguments. The first input value
is the data (0-9999) or variable. The second input value is the number of
the word (1–64) to receive the converted value in the block-transfer-read
buffer.
Syntax
PUSH
value to be converted
PUSH
word number (1–64) of BASIC module BTR buffer
CALL 27
Example
>20 PUSH B
: REM THE VALUE TO BE CONVERTED TO 4-DIGIT BCD
>30 PUSH 7
:REM WORD 7 IN THE BTR BUFFER GETS THE VALUE B
>40 CALL 27
:REM DO THE CONVERSION
CALL 26:
BASIC Floating Point to
3.3-Digit Signed BCD
Chapter
CALL 27:
BASIC Floating Point to
4-Digit BCD
Chapter