Call 25: basic floating-point to slc 16-bit binary – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 206

Advertising
background image

Chapter
Call Routines 0–68

12

12 -16

Use CALL 25 to convert a BASIC module floating-point value between 0
and 65535 to its 16-bit binary (or unsigned integer) SLC number and store
the result in the BASIC module output buffer DH-485 common interface
file. This call is used with DH-485 calls for BASIC module to SLC data
conversion. See also CALL 15.

See Chapter 8 for more information.

The fractional part of the BASIC module floating-point value is truncated.
If the BASIC module floating-point value is less than 0, then the value
placed in the output buffer is 0. If the value is greater than +65535, then
the value placed in the output buffer is +65535. You are responsible for
checking the range of the number before conversion.

Input and Output Arguments

This routine has two input and no output arguments. The first input value
is the data you want to convert to 16-bit binary. The second input value is
the address number (100 to 139) of the word in the BASIC module output
buffer to receive the converted value.

Syntax

PUSH

value to be converted

PUSH

word number (100–139) of BASIC module output buffer

CALL 25

Example

>40 PUSH 0A5H : REM THE VALUE TO BE CONVERTED

>50 PUSH 110 : REM WORD 110 OF BASIC MODULE OUTPUT BUFFER

>60 CALL 25 : REM DO F.P. TO 16-BIT BINARY CONVERSION

CALL 25:
BASIC Floating-Point to SLC
16-Bit Binary

Chapter

Advertising