Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 94

Advertising
background image

Operating Functions

Chapter 5

5–57

5.7.10.1
Internal Floating Point to 3-Digit, Signed, Fixed Decimal BCD

"XXX –

CALL 20

This routine has two input arguments and no output arguments. The first
argument is the variable with a value in the range of –999 to +999 that is
converted to a signed 3-digit binary coded decimal format used by the
processor. The second input argument is the number of the word to receive
the value in the read-block-transfer buffer. The sign bit is bit number 16.

Example:

u20 PUSH W :REM DATA TO BE CONVERTED

u30 PUSH 6 :REM WORD LOCATION TO GET DATA

u40 CALL 20

5.7.10.2
Internal Floating Point to 16-Bit Unsigned Binary (4 digit hex) –
CALL 21

This routine takes a value between 0 and 65535 and converts it to its
binary representative and stores this in the read-block-transfer buffer in one
word. Two arguments are PUSHed and none POPed. The first value
PUSHed is the data or variable. This is followed by the number of the
word to receive the value in the read-block-transfer buffer.

Example:

u50 PUSH T :REM THE VALUE TO CONVERTED TO 16 BINARY

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

u70 CALL 21 :REM DO THE CONVERSION

5.7.10.3
Internal Floating Point to 4-Digit, Signed Octal

"XXXX–Call 22

This routine converts a value from internal format to a four digit signed
octal value. Two arguments ar PUSHed and non POPed. The first value
PUSHed is the data (

"7777

8

) or variable. This is followed by the number

of the word to receive the value in the read-block-transfer buffer. The sign
bit is bit number 16.

Example:

u50 PUSH H :REM THE VALUE TO CONVERTED TO 4-DIGIT SIGNED OCTAL

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

u70 CALL 22 :REM DO THE CONVERSION

5.7.10
Output Call Conversion
Routines (continued)

Advertising