ProSoft Technology MVI56-BAS User Manual
Page 87
MVI56-BAS ♦ ControlLogix Platform
Using DF1 Protocol Communications
BASIC Module (DB/BAS Compatible)
User Manual
ProSoft Technology, Inc.
Page 87 of 234
December 13, 2011
7.5
Sending a DF1 Write Command
In order to write data from the CLX to a DF1 node, you must set up the data
transfer parameters using CALL 123 after PRT2 has been enabled for DF1
communication using CALL 108. CALL 108 must configure PRT2 as a full-duplex
node in order to send a DF1 write command. Some of the parameters are listed
below:
Type of WRITE command
Remote DF1 node address
File number in remote DF1 node
Number of elements to be transferred
Source file (input image, MSG instruction or internal string)
Refer to BASIC CALLs Syntax (page 105) for more information about CALL 123.
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 123:
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 123 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 0: REM Destination File (0=Input Image)
210 PUSH 2: REM Destination file word offset
220 PUSH 0: REM String Number
230 CALL 123
240 POP S: REM Status of CALL
250 PRINT "CALL 122 return code was", S
260 GOTO 260
After the WRITE command is configured using CALL 123, ladder logic is required
to actually send the WRITE command to the remote DF1 node. Input and output
image file word 0 bit 11 are used for handshaking purposes. The transfer
procedure is listed below:
Step 1: The CLX informs the MVI56-BAS that the WRITE command configured
by CALL 123 should be executed turning ON output image word 0 bit 11
(Local:x:O.Data[0].11).
Step 2: The MVI56-BAS module transfers the data to the remote DF1 node.