beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 106

background image

BASIC CALLs Syntax

MVI56-BAS ♦ ControlLogix Platform

User Manual

BASIC Module (DB/BAS Compatible)

Page 106 of 234

ProSoft Technology, Inc.

December 13, 2011

9.1

Data Conversion CALLs

In order for BASIC to communicate with the CLX processor, remote DH-485

modules, and remote DF1 modules, two files have been allocated and defined.

These files are called the BASIC Input Buffer and the BASIC Output Buffer. The

BASIC Input Buffer contains data that BASIC can read from other devices and is

defined as follows:

Address

Definition

0 to 39

DH-485 Common Interface File - data written by other devices

40 to 99

Reserved

100 to 199

Data transferred from the CLX using Message instruction

200 to 231

Data transferred from the CLX Output Image file

The BASIC Output Buffer contains data for other devices which BASIC can write

and is defined as follows:

Address

Definition

0 to 39

DH-485 Common Interface File - data read by other devices

40 to 99

Reserved

100 to 199

Data read by the CLX using MSG instruction

200 to 231

Data transferred to the CLX Input Image file

Word 200 in the BASIC Output Buffer is special. This word corresponds to word

0 of the CLX input image. The upper three bits of this word are reserved. Bit 15

indicates whether BASIC is in RUN mode or COMMAND mode (0=RUN,

1=COMMAND). Bits 14 and 13 are reserved. If the user attempts to use word

200 of the BASIC Output Buffer, be aware that the upper three bits will be

masked off and used as described above.

9.1.1 Input CALLs

CALL 14: Convert 16-Bit Signed to Float Point

Use CALL 14 to convert a 16-bit signed integer 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.

Syntax:

PUSH [A]
CALL 14
POP [B]

Where:
A = input buffer word address (0 to 231)
B = converted value

Example:

10 REM Example Program
20 PUSH 0: REM Convert 1st word of BASIC Input Buffer
30 CALL 14: REM Do 16-Bit signed to F. P. Conversion