ProSoft Technology MVI56-BAS User Manual
Page 85

MVI56-BAS ♦ ControlLogix Platform
Using DF1 Protocol Communications
BASIC Module (DB/BAS Compatible)
User Manual
ProSoft Technology, Inc.
Page 85 of 234
December 13, 2011
7.4
Sending a DF1 Read Command
In order to read data from a DF1 node, it is required to set up the data transfer
parameters using CALL 122 after PRT2 has been enabled for DF1
communications using CALL 108. CALL 108 must configure PRT2 to a full-
duplex node in order to send a DF1 read command. Some of the parameters are
listed below:
Type of READ command
Remote DF1 node address
File number in remote DF1 node
Number of elements to be transferred
Destination file (input image, MSG instruction or internal string)
Refer to BASIC CALLs Syntax (page 105) for more information about CALL 122.
The following shows an example BASIC program that shows how to enable the
DF1 driver using CALL 108. It then configures a remote READ command using
CALL 122:
10 REM Enable DF1 Driver
20 MODE ( PRT2, 19200, N, 8, 1, N, R)
30 CALL 113: REM Disable any Existing DF1 Drivers
40 PUSH 18: REM NHS,ER,Disable DPD,CRC
50 PUSH 200: REM 10 Second Timeout
60 PUSH 2: REM ENQ Retries
70 PUSH 0: REM NAK Retries
80 PUSH 0: REM N/A
90 PUSH 2: REM Module Address
100 CALL 108
110 REM CALL 122 Test
120 REM Reads a DF1 Node
130 PUSH 2: REM PLC/2 File Type
140 PUSH 1: REM Remote Node Address
150 PUSH 7: REM Remote File Number
160 PUSH ASC( N): REM Integer File Type
170 PUSH 0: REM Starting Word Offset
180 PUSH 5: REM Number of elements to read
190 PUSH 10: REM Timeout in 0.1s increments
200 PUSH 1: REM Destination File (1=MSG)
210 PUSH 2: REM Destination file word offset
220 PUSH 0: REM String Number
230 CALL 122
240 POP S: REM Status of CALL
250 PRINT "CALL 122 return code was", S
260 GOTO 260
After the READ command is configured, ladder logic is required to actually send
the READ command to the remote DF1 node. Input and output image file word 0
bit 10 are used for handshaking purposes. The transfer procedure is listed below:
Step 1: The CLX informs the MVI56-BAS that the READ command configured by
CALL 122 should be executed, turning ON output image word 0 bit 10
(Local:x:O.Data[0].10).
Step 2: The MVI56-BAS module sends the READ command to the remote DF1
node which replies with the data.