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

Page 95

Advertising
background image

Operating Functions

Chapter 5

5–58

5.7.10.4
Internal Floating Point to 6-Digit, Signed, Fixed Decimal BCD
"XXXXXX – CALL 23

This routine converts an internal 6-digit, signed, integer to a 2 word format
and places the converted value in the read-block-transfer buffer. 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. The sign bit is bit number 16.

Example:

u20 PUSH 654321. OR

u20 PUSH B(I)

u30 PUSH 3

u30 PUSH 3

u40 CALL 23

u40 CALL 23

5.7.10.5
Internal Floating Point to 3.3-digit, Signed, Fixed Decimal BCD
"XXX.XXX – CALL 26

This routine converts a variable in internal format to a signed, 6-digit,
fixed decimal point number which is stored in 2 words in the
block-transfer-read buffer. Two arguments are PUSHed and none POPed.
The first value PUSHed is the data (

"999.999) or variable. This is

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

Example:

u50 PUSH S

:REM THE VALUE TO BE CONVERTED TO 3.3-DIGIT FIXED POINT

u60 PUSH 3

:REM WORD 3 IN THE BTR BUFFER GETS THE VALUES

u70 CALL 26

:REM DO THE CONVERSION

5.7.10.6
Internal Floating Point to 4-digit BCD XXXX – CALL 27

This routine converts a value in internal floating point format to a 4-digit,
unsigned BCD value and places it in the read-block-transfer buffer. Two
arguments are PUSHed and none POPed. The first value PUSHed is the
data (0–9999) or variable. This is followed by the number of the word to
receive the value in the read-block-transfer buffer.

Example:

u20 PUSH B

REM THE VALUE TO BE CONVERTED TO 4-DIGIT BCD

u30 PUSH 7

:REM WORD 7 IN THE BTR BUFFER GETS THE VALUE B

u40 CALL 27

:REM DO THE CONVERSION

5.7.10
Output Call Conversion
Routines (continued)

Advertising