beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 102

background image

Using DH-485 Communications

MVI56-BAS ♦ ControlLogix Platform

User Manual

BASIC Module (DB/BAS Compatible)

Page 102 of 234

ProSoft Technology, Inc.

December 13, 2011

In order to transfer data from a Remote Common Interface File (CIF) DH-485

data file to the MVI56-BAS input buffer, use CALL 92. After the data has moved

into the input buffer, the program must use CALL 14 or 15 to retrieve the data

(starting at address 0). Up to 40 words can be transferred using CALL 92.

The following BASIC program is an example of how to transfer data using these

concepts. CALL 92 transfers data from the DH-485 remote data file to the MVI56-

BAS input buffer. You can then use CALL 14 (or CALL 15) to retrieve the data

from the input buffer.

10 REM EXAMPLE PROGRAM FOR BASIC CALL 92
20 PUSH 5: REM REMOTE NODE ADDRESS
30 PUSH 0: REM REMOTE OFFSET
40 PUSH 20: REM ELEMENT LENGTH
50 PUSH 20: REM TIMEOUT
60 CALL 92
70 POP E: REM CALL STATUS
80 IF E<>0 THEN GOTO 160 ELSE GOTO 90
90 FOR I=0 TO 19
100 PUSH I: REM THE ADDRESS NUMBER AT THE INPUT BUFFER
110 CALL 14:
120 POP V: REM VALUE AT ADDRESS I
130 PRINT "VALUE AT POSITION ",I," = ",V
140 NEXT I
150 GOTO 170
160 PRINT "CALL 92 ERROR - CODE = ",E
170 END

8.6.1 Using the MVI56-BAS Common Interface File (CIF)

The MVI56-BAS has a internal Common Interface File (CIF) that can be used

while communicating with other nodes at the DH-485 network. The CIF contains

40 words of data that can be read or written from an external device in the

network. In order to transfer data between a MVI56-BAS buffer and the CIF, the

following CALLs can be used:
CALL 85: Transfer BASIC Output Buffer to DH-485 CIF
CALL 84: Transfer DH-485 CIF to BASIC Input Buffer