Rockwell Automation 57C329 Remote I/O Communications, AutoMax User Manual

Page 76

Advertising
background image

4Ć14

RIONET_OK should be included in the READY sequence. It is set by

the BASIC task shown in 4.7.2.3. Note that the trailing at" symbol

(@) is not used for Boolean variables in ladder logic tasks.

4.7.2.3

BASIC Task Example
The following is an example of a BASIC task for the Remote I/O

network in figure 4.4. The task is composed of three main sections.

The first section, lines 1300 to 1500, checks to see if network drops 2

and 4 are recognized by the master. If they are not recognized, the

program will continue to loop until they are. The second section, lines

2400 to 2500, configures drop 2. This is done by writing to variable

D02_CFG%, the configuration register. Once the configuration word

has been written, the configuration ready bit (10) is set. Note that

drop 4 does not need to be configured in this way since it is an all

digital rack. The last section of the task, lines 3300 to 3700, simply

writes the analog input value SPD_REF% to indicator SPD_IND%. If

either drop 2 or drop 4 malfunctions, the program will go to line 300

and wait for the affected drop to recover.

10

!

20

! Shark RIO BASIC Example

30

!

100

COMMON RIO_D02@

200

COMMON RIO_D04@

300

COMMON SPD_REF%

400

COMMON SPD_IND%

500

COMMON RUN@

600

COMMON RIONET_OK@

700

COMMON D02_CFG@

800

COMMON D02_CFG_RDY@

1000

!

1100

!ąăWait for slave drops to come onĆline. The program will

1200

!ąăloop until drops two and four come onĆline.

1300

RIONET_OK@ = FALSE

\ SPD_IND% = 0

1400

DELAY 1 TICKS

1500

IF NOT (RIO_D02@ AND RIO_D04@) THEN GOTO 1400

1600

!

1700

!ąConfigure Shark Remote I/O racks

1800

!ąDrop 4 is an all digital rack and does not need to be

1900

!ąąconfigured

2000

!ąDrop 2 is a mixed rack. By default slots are configured

2100

!ąąas analog. Configure slot 5 as digital and set

2200

!ąąthe configuration ready bit (15).

2300

!

2400

D02_CFG% = 20H

\!Set the configuration word

2500

D02_CFG_RDY@ = TRUE

\!Set the configuration complete bit

2600

!

2700

!ąSet RIO ready for pc task

2800

!

2900

RIONET_OK@ = TRUE

3000

!

3100

!ąTask loop

3200

!

3300

IF NOT RUN@ THEN SPD_IND% = 0 \ GOTO 3500

3400

SPD_IND% = SPD_REF%

3500

IF NOT (RIO_D02@ AND RIO_D04@) THEN GOTO 1300

3600

DELAY 1 TICKS

3700

GOTO 3300

3800

END

The symbolic names defined as COMMON" reference the I/O points

defined in the configuration for the Remote I/O network.

Advertising