beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 98

background image

Using DH-485 Communications

MVI56-BAS ♦ ControlLogix Platform

User Manual

BASIC Module (DB/BAS Compatible)

Page 98 of 234

ProSoft Technology, Inc.

December 13, 2011

8.4

Data Transfer Between a MVI56-BAS Internal String and a Remote
DH-485 SLC Data File

In order to transfer data between a MVI56-BAS internal string and a remote DH-

485 SLC data file, use CALL 29 with CALLs 27 or 28. This method does not

require ladder logic:

The following is an example BASIC program that uses CALL 29 to read data

from a remote DH-485 SLC data file:

10 STRING 100, 90
80 PUSH 2, 5, 9, ASC( N), 0, 5, 20, 2, 0, 0: CALL 27: POP S
90 PUSH 27: CALL 29: POP R
95 PRINT "S =", S, " R =", R
100 GOSUB 1000
130 END
1000 FOR M = 1 TO 20
1010 PH0. ASC( $ ( 0), M),
1020 NEXT M
1030 PRINT
1040 RETURN

The following is an example BASIC program that uses CALL 29 to write data to a

remote DH-485 SLC data file:

10 STRING 100, 90
20 $ ( 0) = "Hello World"
30 PRINT $ ( 0)
80 PUSH 2, 5, 9, ASC( N), 0, 5, 20, 2, 0, 0: CALL 28: POP S
90 PUSH 28: CALL 29: POP R
95 PRINT "S =", S, " R =", R
130 END