ProSoft Technology MVI56-BAS User Manual
Page 109

MVI56-BAS ♦ ControlLogix Platform
BASIC CALLs Syntax
BASIC Module (DB/BAS Compatible)
User Manual
ProSoft Technology, Inc.
Page 109 of 234
December 13, 2011
CALL 89: CLX Floating Point to BASIC Float Point
Use CALL 89 to convert a CLX floating point from the MVI56-BAS input buffer to
a BASIC floating point value. This CALL can be used to read data transferred
from the ControlLogix processor using CALLs 53 and 56. Because the CLX
floating point format requires two words, the offset in the BASIC Input Buffer is
limited to even values. Odd offset values will generate an error.
Syntax:
PUSH [A]
CALL 89
POP [B]
Where:
A = input buffer word address (0 to 230, even values only!)
B = converted value
Example:
10 REM Example Program
20 PUSH 0: REM Convert 1st word pair of BASIC Input Buffer
30 CALL 89: REM Do CLX F. P. to BASIC F. P. Conversion
40 POP W: REM Get converted value
50 PRINT W
9.1.2 Output CALLs
CALL 24: Convert Floating Point Data to 16-Bit Signed Integer
CALL 24 converts a floating point data value to a 16-bit integer (-32768 to
+32767) and places the result into the module output buffer. If the value to be
converted is less than -32768, then -32768 will be used. If the value to be
converted is greater than 32767, then 32767 will be used. No error will be
generated in either case.
Syntax:
PUSH [A]
PUSH [B]
CALL 24
Where:
A = value to be converted
B = word address of output buffer (between 0 and 231)
Example:
10 DIM A(32)
.
.
.
210 GOSUB 720