Rockwell Automation 57C442 Data Highway Plus Interface Module User Manual

Page 35

Advertising
background image

4-17

Example 1: Command 3, Word Range Read

In the example below, the Data Highway Plus Interface module is
reading 100 words from file N7:0 in the PLC at station address 0. The
data read is stored in the local B3 file. The variable B3BASE% is
defined in the rack configuration.

10 COMMON B3BASE% \!

Represents the physical address of &
the starting register on the

&

Data Highway Plus module to be
read from

20 LOCAL DST%

\!

The address of the destination node &
on the local Data Highway Plus network

21 LOCAL STS%

\!

The location where the status
resulting from the operation is stored

22 LOCAL SZE%

\!

The number of registers to be

&

transferred

23 LOCAL CMD%

\!

The Data Highway Plus command &
sent by the module

30 DST% = 0
31 STS% = 0
32 SZE% = 100
33 CMD% = 3
40 IF NOT GATEWAY_CMD_OK@(STS%, CMD%, DST%, “N7:0”, &

VARPTR!(B3BASE%), SZE%) THEN 20000 \! process errors &
at line 2000

Example 2: Command 4, Word Range Write

In the example below, the Data Highway Plus Interface module is
writing 100 words from the local N7 file to the file address N10:10 in the
PLC at station address 0. The variable N7BASE% is defined in the rack
configuration.

10 COMMON N7BASE% \!

Represents the physical address of &
the starting register on the

&

Data Highway Plus module to be

&

written to

20 LOCAL DST%

\!

The address of the destination node
on the localData Highway Plus network

21 LOCAL STS%

\!

The location where the status

&

resulting from the operation is stored

22 LOCAL SZE%

\!

The number of registers to be

&

transferred

23 LOCAL CMD%

\!

The Data Highway Plus command sent
by The module

30 DST% = 0
31 STS% = 0
32 SZE% = 100
33 CMD% = 4
40 IF NOT GATEWAY_CMD_OK@(STS%, CMD%, DST%, “N10:10, &

VARPTR!(N7BASE%), SZE%) THEN 20000 \! process errors at&
line 20000

Advertising