Example 5 - change presets dynamically, Example 5 - change presets dynamically -18 – Rockwell Automation 1746-HSCE2 Multi-Channel High Speed Counter Module User Manual

Page 110

Advertising
background image

Publication 1746-UM002B-EN-P - August 2004

6-18 Application Examples

Data Table for N10 File (hexidecimal)

Data Table for N11 File (decimal)

Example 5 - Change Presets
Dynamically

This example shows the user how to dynamically change the preset
value using the Min/max Count Block.

1. The following procedure uses the Example 2 program (SLC 5/03

or higher processor in Class 4, mode 1).

2. The Min/max Count Value requires the use of handshaking bits

to get the preset values into the 1746-HSCE2. Therefore, the
handshaking code is in a separate subroutine (ladder file 14).
The ladder rungs which trigger the dynamic preset change are in
the 1746-HSCE2 routine (ladder file 8).

3. Before and after the Min/max Count Block with the new preset

value is transferred to the 1746-HSCE2, the Counter Control
Block (with the transmit bit reset), is in the 1746-HSCE2’s output
image. Leaving the Counter Control Block in the module’s
output image allows for easy disabling of the counters and
implementing of soft presets.

Programming Blocks

Offset

0

1

2

3

4

5

6

7

8

9

Module Setup

N10:0

1

101

8

0

0

0

0

0

0

0

Counter Configuration

N10:10

302

1C

0

C

0

0

0

0

0

0

Min/Max Count Value Counter 1 N10:20

4

0

0

2

30

0

82

0

0

0

Min/Max Count Value Counter 2 N10:30

104

0

0

7

C8

0

0

0

0

0

Min/Max Rate Value

N10:40

8

FF9C

0

64

0

0

0

0

0

0

Program Ranges

N10:50

410

1

0

0

4

3E7

1

0

0

0

Program Ranges

N10:60

410

2

5

0

9

3E7

2

0

0

0

Program Ranges

N10:70

410

4

A

0

E

3E7

1

0

0

0

Program Ranges

N10:80

410

8

F

0

13

3E7

2

0

0

0

Program Ranges

N10:90

410

10

14

0

18

3E7

1

0

0

0

Program Ranges

N10:100

410

20

19

0

1D

3E7

2

0

0

0

Program Ranges

N10:110

410

40

1E

0

22

3E7

1

0

0

0

Program Ranges

N10:120

410

80

23

0

27

3E7

2

0

0

0

Program Ranges

N10:130

110

100

0

0

1

31F

4

0

0

0

Program Ranges

N10:140

110

200

1

320

3

257

8

0

0

0

Program Ranges

N10:150

110

400

3

258

5

18F

4

0

0

0

Program Ranges

N10:160

110

800

5

190

7

C7

8

0

0

0

Counter Control

N10:170

80

8001

8001

0

0

FF00

FFF

0

0

0

Offset

0

1

2

3

4

5

6

7

8

9

N11:0

170

170

17

Advertising