Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 274
Chapter
Call Routines 69–127
13
13 -16
Use this call to convert BASIC floating point to PLC-5 floating point in a
two-word format and place the converted value in the block transfer read
buffer. See also CALL 89.
See Chapter 8 for more information.
The BASIC module floating point number is an 8-digit BCD floating
point number. The range of the BASIC module floating point number is;
±
1E
–127
to
±
.99999999E
+127
The PLC-5 floating point number is a 7-digit binary floating point number
(IEEE Float 32- bit value). The range of the PLC-5 floating point number:
±
1.1754944E
–38
to
±
3.4028237E
+38
The BASIC module has a floating point range larger than the floating point
range of the PLC-5 processor. If CALL 88 attempts to convert a number
larger than
±
3.4028237E
+38
, the converted number is assigned a value of
±
3.4028237E
+38
. If CALL 88 attempts to convert a number smaller than
±
1.1754944E
–38
, the converted number is assigned a value of
±
1.1754944E
–38
.
PLC-5 floating point numbers are stored in 2 words of the BTR buffer
Important: Due to the fact that the PLC-5 floating point number is a
7-digit floating point number, and the BASIC module is an 8-digit floating
point number, some round off error may be introduced during number
conversions.
Input and Output Arguments
This routine has two input arguments and no output arguments. The first
input argument is the floating point value you want to convert. The second
input argument is the first word in the BTR buffer (1 to 63) to receive the
converted value.
Syntax
PUSH
number to convert
PUSH
output buffer to receive converted value
CALL 88
Example
>20 PUSH V :REM V F.P. NUMBER TO CONVERT
>30 PUSH 1 :REM WORD 1 and 2 of BTR BUFFER GETS A VALUE OF V
>40 CALL 88 :REM CONVERT VALUE
CALL 88: BASIC Floating
Point to PLC-5 Floating
Point
Chapter