284 Rockwell Automation Publication 2080-UM002N-EN-E - November 2022
Appendix B          Quickstarts
MyAppData.HscMode allows the user to specify the type of operation in which the HSC will use 
to count. See HSC Mode (HSCAPP.HSCMode)
 on page 204 for more information about HSC 
modes. See Table 70
 for the list available modes.
Modes 1, 3, 5, 7, and 9 will only work when an ID of 0, 2, or 4 is set due to the fact that these 
modes use reset and hold. Modes 0, 2, 4, 6, and 8 will work on any ID. Modes 6…9 will only work 
when an encoder is connected to the controller. Use the HSC ID chart as a reference to wire 
the encoder to the controller.
MyAppData.HPSetting, MyAppData.LPSetting, MyAppData.OFSetting, and 
MyAppData.UFSetting are all user-defined variables that represent the counting range of the 
HSC. Figure 29 on page 284
 gives an example of a range of values that can be set for these 
variables.
Figure 29 - Range of Values
 
MyAppData.OutputMask along with MyAppData.HPOutput and MyAppData.LPOutput allows 
the user to specify which embedded outputs can be turned on when a High Preset or Low 
Preset is reached. These variables use a combination of decimals and binary numbers to 
specify the embedded outputs that are able to turn on/off. 
Thus, in our example, we first set the Output Mask to a decimal value of 3 which, when 
converted to binary, is equal to 0011. This means that now outputs O0 and O1 can be turned
On/Off. 
We have set the HPOutput to a decimal value of 1, which, when converted to binary, is equal to 
0001. This means that when a High Preset is reached, output O0 will turn on and stay on until 
the HSC is reset or the counter counts back down to a Low Preset. The LPOutput works same 
way as the HPOutput except an output will be turned on when a Low Preset is reached.
Table 70 - HSC Operating Modes
Mode 
Number
Type
0
Up Counter – The accumulator is immediately cleared (0) when it reaches the high preset. A low 
preset cannot be defined in this mode.
1
Up Counter with external reset and hold – The accumulator is immediately cleared (0) when it 
reaches the high preset. A low preset cannot be defined in this mode.
2 Counter with external direction
3 Counter with external direction, reset, and hold
4 Two input counter (up and down)
5 Two input counter (up and down) with external reset and hold
6 Quadrature counter (phased inputs A and B)
7 Quadrature counter (phased inputs A and B) with external reset and hold
8 Quadrature X4 counter (phased inputs A and B)
9 Quadrature X4 counter (phased inputs A and B) with external reset and hold
+2,147,483,647 maximum
-2,147,483,648 
Overflow
High Preset
0
Low Preset
Underflow
HscAppData.OFSetting
HscAppData.HPSetting
HscAppData.LPSetting
HscAppData.UFSetting
Variable