Rockwell Automation 1746-HSCE2 Multi-Channel High Speed Counter Module User Manual
Page 113
Publication 1746-UM002B-EN-P - August 2004
Application Examples 6-21
Ladder File 14 - Preset Change Subroutine
0000
O:1
15
OTHER
HSCE2_XMIT
I:1
15
OTHER
HSCE2_ACK
B3:0
5
PRESET_ENABLE
COP
Copy File
Source
#N7:0
Dest
#N10:25
Length
2
COP
COP
Copy File
Source
#N10:20
Dest
#O:1.0
Length
8
COP
#HSCE2_CFG_BLK
L
O:1
15
OTHER
HSCE2_XMIT
U
B3:0
5
PRESET_ENABLE
0001
O:1
15
OTHER
HSCE2_XMIT
I:1
15
OTHER
HSCE2_ACK
U
O:1
15
OTHER
HSCE2_XMIT
MEQ
Masked Equal
Source
I:1.0
265<
Mask
2000h
8192<
Compare
0
0<
MEQ
L
B3:0
1
HSCE2_ERROR
0002
O:1
15
OTHER
HSCE2_XMIT
I:1
15
OTHER
HSCE2_ACK
U
B3:0
4
PRESET_CHANGE_LATCH
COP
Copy File
Source
#N10:[N11:0]
Dest
#O:1.0
Length
8
COP
#HSCE2_CFG_BLK
0003
END
Copy the new preset value (N7:0 and N7:1) into counter 1’s min/max count block (N10:25 and N10:26). Copy this block into the
1746-HSCE2 output image, and set the 1746-HSCE2 transmit bit (O:1.0/15).
When the 1746-HSCE2 sets its acknowledge bit (I:e.0/15), reset the transmit bit
(O:e.0/15), and check for a programming error.
When the Min/max Count Block transfer is completed, reload the Counter Control
Block to the 1746-HSCE2 to permit soft presets, disabling counters, etc.