ProSoft Technology MVI56-BAS User Manual
Page 89

MVI56-BAS ♦ ControlLogix Platform
Using DF1 Protocol Communications
BASIC Module (DB/BAS Compatible)
User Manual
ProSoft Technology, Inc.
Page 89 of 234
December 13, 2011
7.6
Receiving a DF1 Write Command
In order to receive a write command from a remote DF1 node, you must set up
the data transfer parameters using CALL 118. Some of the parameters are listed
below:
CLX destination file
Word offset in destination file
Maximum word length
Refer to BASIC CALLs Syntax (page 105) for more information about CALL 118.
The following shows a BASIC program example that shows how to enable the
DF1 driver using CALL 108. It then allows PRT2 to receive DF1 WRITE
commands using CALL 118:
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 2: 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 118
120 REM Reads a DF1 Node
130 PUSH 1: REM CALL ENABLE/DISABLE
140 PUSH 1: REM DESTINATION FILE
150 PUSH 0: REM OFFSET IN DESTINATION FILE
160 PUSH 2: REM STRING NUMBER (NOT USED HERE)
170 PUSH 50: REM MAXIMUM WORD LENGTH
180 CALL 118
190 POP M: REM CALL 118 STATUS
200 PRINT "STATUS CALL 118 -> ", M
250 PRINT "CALL 118 return code was", S
260 GOTO 260
After CALL 118 is executed, ladder logic is required for handshaking when a new
WRITE command is received at PRT2. Input and output image file word 0 bit 12
must be used in ladder logic. The transfer procedure is listed below:
Step 1: A DF1 write command is received at the MVI56-BAS PRT2. The MVI56-
BAS module transfers the data into the CLX internal buffer. The BASIC module
also places the byte count into the first available word of the destination file.
Step 2: The MVI56-BAS sets the input file word 0 bit 12 (Local:x:I.Data[0].12) to
inform the CLX that the data is available.
Step 3: The CLX ladder logic retrieves the data from the buffer and sets the
output file word 0 bit 12 (Local:x:O.Data[0].12) to inform the MVI56-BAS module
that the data was received.
Step 4: The MVI56-BAS module resets input image word 0 bit 12
(Local:x:I.Data[0].12).
Step 5: The CLX resets output image word 0 bit 12 (Local:x:O.Data[0].12).