Application example – Rockwell Automation AutoMax ControlNet Communication Interface Module User Manual
Page 33

AutoMax ControlNet Module Page
33
Publication number DSMBCN-UM001B-EN-P February 2003
There is usually some header information included with the data for each
connection. The amount varies with the type of device the MBCN is
connected to. RSNetWorx displays input and output sizes in the form
9(6). This means that the connection uses 9 words in total, with 6 words
of data and 3 words of header. If the address assigned to the connection
is 16384, this means that addresses 16384, 16385 and 16386 contain the
header, and that addresses 16387-16392 contain the 6 words of data.
Use this information to obtain the data addresses to use in your AutoMax
program.
Application Example
In the following example, the MBCN occupies slot 9 in an AutoMax
rack.
In AutoMax Programming Executive Version 3.0 and later, you define
these registers using the Variable Configurator.
If you are using AutoMax Programming Executive Version 2.1 or earlier,
you define these registers using IODEF statements in the rack
configuration task.
0100 TASK CNSCAN[TYPE=BASIC, PRIORITY=11, SLOT=0, CRITICAL=FALSE]
0110 IODEF CN_RUN@[SLOT=9, REGISTER=5, BIT=1]
0120 IODEF NAMSTATE%[SLOT=9, REGISTER=9473]
0300 IODEF INP_WRD_0%[SLOT=9, REGISTER=16393]
0310 IODEF INP_WRD_1%[SLOT=9, REGISTER=16394]
0400 IODEF OUT_WRD_0%[SLOT=9, REGISTER=24588]
0410 IODEF OUT_WRD_1%[SLOT=9, REGISTER=24589]
32767 END
The following BASIC program checks the NAM state for the attached
state before it puts the MBCN in run mode and starts accessing data, then
copies an input word to an output, and increments another output word.
0001 REM SAMPLE PROGRAM
0100 COMMON CN_RUN@
0110 COMMON NAMSTATE%
0120 COMMON INP_WRD_0%
0130 COMMON INP_WRD_1%
0140 COMMON OUT_WRD_0%
0150 COMMON OUT_WRD_1%
0160 COMMON REC_STAT1%