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

Page 118

Advertising
background image

Publication 1747-RM623D-EN-P - June 2006

E-40 Application Examples

A sample Basic module program using CALL 23 for PT1 and CALL 22
for PRT2 follows, along with the necessary ladder logic to handshake
with the module for these CALLs. When the SLC processor is placed
into the Run mode, it in turn places the 1747-SCNR scanner into the
Run mode as well by virtue of the unconditional OTE rung described
above.

When the Basic module is also placed into the Run mode, any data
placed into the SLC processor’s data table beginning with N12:0 is
sent to the 1747-SCNR scanner, which sends it to the 1747-ACNR15
module via ControlNet and then to the Basic module. The Basic
module sends the data out PRT1 and this data is looped right back in
the Basic module’s PRT2.

The module sends the data to the 1747-ACNR15 module, which sends
it to the 1747-SCNR scanner via ControlNet. The SLC processor then
retrieves this data and places it into its data table beginning at N13:0.

Example of Basic Module Program

0 REM BTRAN V1.03, C:\ABBASIC\BDS\CNET_TST.BDL, 11-22-99
02:52pm
10 REM Test Program for CNET
20 MODE(PRT1,9600,N,8,1,N,R)
30 MODE(PRT2,9600,N,8,1,N,R)
40 PUSH 2
50 CALL 37
60 PUSH 2
70 CALL 96
80 REM CALL 23 for PRT1
90 PUSH 2
100 REM SEND DATA OUT PRT1
110 PUSH 1
120 REM GET DATA FROM M0 FILE
130 PUSH 0
140 REM NO OFFSET
150 PUSH 0
160 REM NO STRING USED
170 PUSH 1
180 REM ENABLE BYTE SWAPPING
190 CALL 23
200 POP S1
210 REM STATUS OF CALL 23 SETUP
220 IF (S1<>0) THEN P. "UNSUCCESSFUL CALL 23 SETUP"
230 REM CALL 22 FOR PRT2
240 PUSH 2
250 REM GET DATA FROM PRT2
260 PUSH 126
270 REM MAXIMUM OF 126 CHARACTERS PER TRANSFER

Advertising