Rockwell Automation 1746-HSCE2 Multi-Channel High Speed Counter Module User Manual
Page 116

Publication 1746-UM002B-EN-P - August 2004
6-24 Application Examples
Ladder File 8 - HSCE2
0000
S:1
15
MOV
Move
Source
0
0 <
Dest
B3:0
0000000011000001<
MOV
MOV
Move
Source
0
0 <
Dest
N11:0
170 <
MOV
Fill File
Source
0
Dest
Length
8
#O:1.0
FLL
Copy File
Source
#I:1.2
Dest
Length
2
#N10:25
COP
MUL
Multiply
Source A
10
10 <
Source B
N11:2
17 <
Dest
N11:1
170
<
MUL
0001
0002
0003
S:1
15
B3:0
0
B3:0
1
JSR
Jump To Subroutine
SBR File Number
U:9
JSR
FIRST_PASS
FIRST_PASS
B3:0
0
HSCE2_INIT_DONE
HSCE2_INIT_DONE
HSCE2_ERROR
DATA_BLOCK_OFFSET
MAX_BLOCK_ADDR
#HSCE2_CFG_BLK
END
Prior to use, the programmer sets N11:2 to the total number of data blocks which will be entered into file N10 (not including the Counter Control
Block) and initializes the data blocks in file N10. Ten integer data blocks are used (instead of eight) to simplify the display in data windows.
The first pass of the program initializes the following values:
1. The HSCE2 initialization done bit (B3/0) is unlatched.
2. The HSCE2 error bit (B3/1) is cleared.
3. The Counter Configuration Block is cleared. Note: The init HSCE2 routine (ladder file 9) is bypassed during the first pass to ensure the
While the HSCE2 is not initialized, and the HSCE2 has not errored, call the HSCE2
initialization routine.
This rung copies the count value to the preset value, demonstrating how to retain counts. The
rung assumes that the counter control block (last configuration block) is still in the output image
to the 1746-HSCE2.