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

Page 203

Advertising
background image

Chapter
Call Routines 0–68

12

12 -13

Use this routine to convert BASIC floating point to 16-bit binary PLC
number. This routine takes a value between 0 and 65535 and converts it to
its binary representative and stores it in the block-transfer-read buffer in
one word. See also CALL 11.

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 or variable you want to convert to 16-bit binary. 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 location

(1–64)

that receives the value

CALL 21

Example

>50 PUSH T :REM THE VALUE TO BE CONVERTED TO 16 BINARY

>60 PUSH 3 :REM WORD 3 IN THE BTR BUFFER GETS THE VALUE T

>70 CALL 21 :REM DO THE CONVERSION

Use this routine to convert a value from BASIC format to a four-digit,
signed, octal PLC value. See also CALL 12.

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 (+7777

8

) or variable you want to convert to 4-digit, signed

octal. The second input value is the number of the word (1–64) to receive
the converted value in the block-transfer-read buffer. The sign bit is bit
number 16.

Syntax

PUSH

value to be converted

PUSH

word location (1–64) that receives the value

CALL 22

Example

>50 PUSH H :REM THE VALUE TO BE CONVERTED TO 4-DIGIT

SIGNED OCTAL

>60 PUSH 3 :REM WORD 3 IN THE BTR BUFFER GETS THE VALUE H

>70 CALL 22 :REM DO THE CONVERSION

CALL 21:
BASIC Floating Point to
16-Bit Binary

Chapter

CALL 22:
BASIC Floating Point to
4-Digit, Signed Octal

Chapter

Advertising