Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 104

Advertising
background image

Chapter 6

Using the Ethernet Interface

6-23

All external access to the control coprocessor’s user memory is through the
TAG table of the coprocessor. The TAG functions provide a way for you
to specify access to control-coprocessor memory. The memory of the
tagged area can be of any data type—e.g., char, short, float, etc.—or
combination of data types. It is your responsibility to understand the
layout of the tagged memory. Transmission or reception of tagged
memory data is done as a “byte stream.” External devices can have
different memory structures—i.e., byte order, data sizes, etc. When
reading tagged data from the coprocessor, the external process must
accommodate the differences when interpreting the byte stream. Similarly,
when writing to the tagged area, the external process must generate a byte
stream to match that of the coprocessor tagged memory.

EXAMPLE Program of INTERCHANGE Access

to CoprocessorĆTagged Memory

The following example illustrates how to set up the tagged memory of the
coprocessor and access that memory over Ethernet using INTERCHANGE
software on the host computer.

In this example, we set up a tagged area defined by the structure CAR.
The TAG name “Car” points to the start of the CAR structure. The
memory allocated by the OS9 compiler for the CAR structure is:

Structure

Offset

Allocation

CAR Ć>

00

make (bits 31Ć24)

01

make (bits 23Ć16)

02

make (bits 15Ć8)

03

make (bits 7Ć0)

04

model

05

type

06

color

07

pad" byte

08

year (bits 31Ć24)

09

year (bits 23Ć16)

10

year (bits 15Ć8)

11

year (bits 7Ć0)

Note the inclusion of a “pad” byte generated by the compiler. The pad
byte is necessary to make

year

start on an even addressed boundary. This

illustrates how imperative it is that you know the exact memory layout of
the tagged area.

The following example of a coprocessor program creates the Car TAG and
periodically increments the make, model and type elements of the
structure. In this example, the coprocessor is set up to be station 22 octal
(12h). To increase readability of the example, no error checking is done.

Advertising