Rockwell Automation 1747-SCNR ControlNet Scanner Module Reference Manual User Manual

Page 117

Advertising
background image

Publication 1747-RM623D-EN-P - June 2006

Application Examples E-39

Creating Ladder Logic and Basic Module Program

The final step is to write a ladder program for the SLC processor and a
Basic program for the Basic module. After downloading the program
to your processor and to your basic module, place the processor into
the Run mode and run your Basic program as well. Your programs
should now be able to read data from the 1746-IA16 in word I:3.3 and
write to the 1746-OB16 in word O:3.2.

The attached basic program contains a CALL 23 interrupt CALL for
PRT1 and a CALL 22 interrupt CALL for PRT2. The CALL 23 sends data
out PRT1 when data is received from the SLC processor and CALL 22
transfers data sent in PRT2 to the SLC processor. Remember, the first
eight words beginning with M1:3.3 and M0:3.3 are from the Basic
module’s Input and Output image. The following 64 words are from
the Basic module’s M1 and M0 files.

The handshaking required between the SLC processor and the Basic
module to transfer data, is shown in the ladder logic program to
follow. Refer to the 1746-BAS BASIC Language Reference Manual,
publication 1746-RM001 for a complete description of CALL 22 and 23,
as well as the required handshaking. The only difference in the
handshake logic when using these Basic module CALLs is that the I/O
image words used for the handshaking are stored in the 1747-SCNR’s
M-files, so they appear as M-file addresses in the ladder logic instead
of I/O addresses.

Connect an RS-232 cable between PRT1 and PRT2 on the Basic
module. A 1747-CP3 cable will work for this purpose. When up to 64
words of data are placed into SLC processor’s data table beginning at
N12:0, it will be sent to the 1747-SCNR scanner, then to the Basic
module via ControlNet and the 1747-ACNR15 and will ultimately be
sent out PRT1 of the BAS module. If you used a cable to loop the data
back in PRT2, this data will be sent to the 1747-SCNR scanner via
ControlNet and will ultimately appear in the SLC processor’s data table
beginning with address N13:0.

Note that your ladder program should also contain an unconditional
rung with an OTE instruction addressed to the 1747-SCNR scanner’s
Run/Idle bit, O:3.0/10 for this example. When the SLC processor is
placed into the Run mode, this rung will set the 1747-SCNR scanner’s
Run/Idle bit and place the scanner into the Run mode as well. The
scanner will begin executing the configured connections when the
Run/Idle bit is set.

Advertising