Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 275

Advertising
background image

Chapter
Call Routines 69–127

13

13 -17

Use this call to convert PLC-5 floating point to BASIC floating point.
See also CALL 88.

See Chapter 8 for more information.

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 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

PLC-5 floating point numbers are stored in 2 words of the BTW 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 one input and one output argument. The input argument is
the number (1 to 63) of the first word (PLC-5 floating point is sent to the
BASIC module in two processor words) in the BTW buffer you want to
convert. The output argument is the converted value.

Syntax

PUSH

number of word to convert

CALL 89

POP

converted value

Example

>50 PUSH 10 :REM CONVERT 10th and 11th WORD OF BTW BUFFER

>60 CALL 89 :REM CONVERT VALUE

>70 POP W :REM GET CONVERTED VALUE–STORE IN VARIABLE W

CALL 89: PLC-5 Floating
Point to BASIC Floating
Point

Chapter

Advertising