ProSoft Technology MVI56-BAS User Manual
Page 100
Using DH-485 Communications
MVI56-BAS ♦ ControlLogix Platform
User Manual
BASIC Module (DB/BAS Compatible)
Page 100 of 234
ProSoft Technology, Inc.
December 13, 2011
In order to transfer data from a Remote DH-485 data file to the MVI56-BAS input
buffer, use CALL 90. 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 this method.
The following BASIC program is an example of how to transfer data using these
concepts. CALL 90 transfers data from the DH-485 remote data file to the MVI56-
BAS input buffer. Then, use CALL 14 (or CALL 15) to retrieve the data from the
input buffer.
10 REM EXAMPLE PROGRAM FOR BASIC CALL 90
20 PUSH 5: REM REMOTE NODE ADDRESS
30 PUSH 9: REM REMOTE FILE NUMBER
40 PUSH ASC(N): REM REMOTE FILE TYPE
50 PUSH 0: REM REMOTE OFFSET
60 PUSH 20: REM ELEMENT LENGTH
70 PUSH 5: REM TIMEOUT
80 CALL 90
90 POP E: REM CALL STATUS
100 IF E<>0 THEN GOTO 180 ELSE GOTO 110
110 FOR I=0 TO 19
120 PUSH I: REM THE ADDRESS NUMBER AT THE INPUT BUFFER
130 CALL 14:
140 POP V: REM VALUE AT ADDRESS I
150 PRINT "VALUE AT POSITION ",I," = ",V
160 NEXT I
170 GOTO 200
180 PRINT "CALL 90 ERROR - CODE = ",E
200 END