Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 198

Advertising
background image

Chapter
Call Routines 0–68

12

12 -8

Use this routine to convert 6-digit BCD from the PLC processor to BASIC
floating point. See also CALL 23.

See Chapter 8 for more information.

Input and Output Arguments

This routine has one input and one output argument. The input argument is
the number (1-64) of the first word (6-digit BCD is sent to the BASIC
module in two processor words) of the write-block-transfer buffer you
want to convert from 6-digit, signed, fixed decimal BCD to BASIC
floating point. The maximum values allowed are +999999. The output
argument is the value converted into BASIC floating point format.
The sign bit is bit number 16.

Syntax

PUSH

number of word (1 – 64) to be converted

CALL 13

POP

converted value

Example

> 10 PUSH X

> 20 CALL 13

> 30 POP Y

Use this call to convert an SLC 16-bit signed integer number from an SLC
processor to a BASIC floating-point number. This call is used to convert
SLC signed integer numbers to BASIC floating point. Use it with DH-485
related calls. See also CALL 24.

See Chapter 8 for more information.

Input and Output Arguments

This routine has one input and one output argument. The input argument is
the address number (100 to 139) of the word in the BASIC module input
buffer DH-485 common interface file you want to convert. The output
argument is the value converted into BASIC floating point format.

Syntax

PUSH

number of word to be converted

CALL 14

POP

converted value

Example

>1 REM EXAMPLE PROGRAM

>20 PUSH 101:REM CONVERT 101ST BYTE OF BASIC INPUT BUFFER

>30 CALL 14 : REM DO 16-BIT SIGNED TO F.P. CONVERSION

>40 POP W : REM GET CONVERTED VALUE

>50 PRINT W

CALL 13:
6-Digit Signed, Fixed
Decimal BCD to
BASIC Floating Point

Chapter

CALL 14:
SLC 16-Bit Signed Integer to
BASIC Floating Point

Chapter

Advertising