beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 111

background image

MVI56-BAS ♦ ControlLogix Platform

BASIC CALLs Syntax

BASIC Module (DB/BAS Compatible)

User Manual

ProSoft Technology, Inc.

Page 111 of 234

December 13, 2011

CALL 25: Convert Floating Point Data to 16-Bit Binary

CALL 25 converts a floating point data value to a 16-bit binary representation (0

to 65535) and places the result into the module output buffer. If the value to be

converted is less than 0, then 0 will be used. If the value to be converted is

greater than 65535, then 65535 will be used. No error will be generated in either

case.

Syntax:

PUSH [A]
PUSH [B]
CALL 25

Where:
A = value to be converted
B = word address of output buffer (between 0 and 231)

Example:

10 DIM A(32)
.
.
.
210 GOSUB 720
.
.
700 REM This routine copies data from variable A()
710 REM to the BASIC Output Buffer Input Image area
720 FOR I = 0 TO 31
730 PUSH A(I),I+200: CALL 25
740 NEXT I
750 RETURN