Call 122 – read remote df1 plc data file, Call 122 – read remote df1 plc data file -30, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual
Page 220: Purpose

Publication 1746-RM001A-US-P
13-30 Input Functions
Example
>1
REM EXAMPLE PROGRAM
>10 REM ENABLE PLC/SLC UNSOLICITED WRITE INTERRUPT
>20 PUSH 1 : REM ENABLE THE CALL
>30 PUSH 1 : REM DESTINATION SLC M1 FILE
>40 PUSH 0 : REM WORD OFFSET INTO M1 FILE
>50 PUSH 0 : REM STRING NUMBER - NOT USED
>60 PUSH 20 : REM MAX ALLOWED WORD LENGTH OF DATA PACKET
>70 CALL 118
>80 POP S
>90 IF (S<>0) THEN PRINT “UNSUCCESSFUL CALL 118 SETUP”
>100 GOTO 100 : REM CALL 118 stays active while BASIC program is
running
Below is a sample ladder logic program for CALL 118. The module is located in
slot 1 of the SLC rack. Rung 0000 copies data from the M1 file when the
handshake bit (I:1.0/12) is set by the module. Rung 2:0 sets the handshake bit
(O:1.0/12) once the data has been copied out of the M1 file. This informs the
module to turn off I:1.0/12. The first word is the byte count. A maximum of 20
words of data is expected.
CALL 122 – Read Remote
DF1 PLC Data File
Purpose
Use CALL 122 to read up to 64 words of data from a remote DF1 node (PLC-2,
-3, or -5) to the CPU input image file, the CPU M1 file, and/or a string within the
module.
The following table lists specific notes when using CALL 122 with the PLC-3 and
PLC-5.
0000
I:1
12
COP
Copy File
Source
#M1:1.0
Dest
#N7:0
Length
21
L
O:1
12
0001
END
Handshake Bit from Module
to SLC Processor
Handshake Bit from SLC
Processor to Module
Table 13.9 PLC Application Notes
PLC
Notes
-3
For timers and counters, the file number PUSHed (third parameter) is the
structure number, limited to a maximum of 255 words.
-5
For timer data, an element is three 16-bit words, stored in the destination
file in the following order: Control, Preset, and Accumulator.