Example 4 - using soft presets, Example 4 - using soft presets -14 – Rockwell Automation 1746-HSCE2 Multi-Channel High Speed Counter Module User Manual

Page 106

Advertising
background image

Publication 1746-UM002B-EN-P - August 2004

6-14 Application Examples

Data Table for N10 File (hexidecimal)

Data Table for N11 File (decimal)

Example 4 - Using Soft
Presets

This example illustrates the use of soft presets with the Counter
Control Block. A soft preset loads the specific counter with a preset
count value. This preset value is determined by the last min/max
Count Value Block for that counter. This block is normally loaded
during HSCE2 initialization, but the preset can be changed
dynamically (as shown in Example 5).

1. The ladder logic uses the Example 2 program (SLC 5/03 or

higher processor in Class 4, mode 1).

2. The example soft presets Counter 1 whenever the soft preset

trigger bit (B3/6) sees a positive (0 to 1) transition.

3. The soft preset must wait until after the HSCE2 initialization

process is complete (B3/0 is set).

4. The Counter Configuration Block (N10:10 to N10:17) gate/preset

mode for Counter 1 must allow soft presets. In this case, N10:11
was changed from 0C (No Preset) to 1C (Soft Preset Only).

Programming Blocks

Offset

0

1

2

3

4

5

6

7

8

9

Module Setup

N10:0

1

103

8

0

0

0

0

0

0

0

Counter Configuration

N10:10

F02

6

0

6

0

0

0

0

0

0

Min/Max Count Value Counter 1 N10:20

4

0

0

0

190

0

0

0

0

0

Min/Max Count Value Counter 2 N10:30

104

0

0

0

1F4

0

0

0

0

0

Min/Max Count Value Counter 3 N10:40

204

0

0

0

258

0

0

0

0

0

Min/Max Count Value Counter 4 N10:50

304

0

0

0

2BC

0

0

0

0

0

Counter 1 Program Ranges

N10:60

10

1

0

0

0

31

1

0

0

0

Counter 1 Program Ranges

N10:70

10

2

0

32

0

63

2

0

0

0

Counter 1 Program Ranges

N10:80

10

4

0

64

0

95

4

0

0

0

Counter 1 Program Ranges

N10:90

10

8

0

96

0

C7

8

0

0

0

Counter 1 Program Ranges

N10:100

10

10

0

C8

0

F9

1

0

0

0

Counter 1 Program Ranges

N10:110

10

20

0

FA

0

12B

2

0

0

0

Counter 1 Program Ranges

N10:120

10

40

0

12C

0

15D

4

0

0

0

Counter 1 Program Ranges

N10:130

10

80

0

15E

0

190

8

0

0

0

Counter Control

N10:140

80

8001

8001

8001

8001

FF00

FF

0

0

0

Offset

0

1

2

3

4

5

6

7

8

9

N11:0

140

140

14

0

256

Advertising