Instruction Parameters
Supported PLC Series
| PLC-AES | PLC-FB | PLC-ES |
|---|---|---|
| ✓ | ✓ | ✓ |
Supported Data Registers
| M | X | Y | K | L | F | T | C | S | Z | R | Q | D | @D | Constant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Ch | ✓ | ✓ | ✓ | ✓ | ✓ | – | – | – | – | ✓ | – | ✓ | ✓ | ✓ | ✓ |
| D | ✓ | – | ✓ | ✓ | ✓ | – | – | – | – | ✓ | – | ✓ | ✓ | ✓ | – |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | – |
| Carry | F11.2 | – |
Number of Steps
| Steps |
|---|
| 3 |
Operands
| Operand | Description |
|---|---|
| Ch | The first operand. Entries are WORD data registers or constants. This is the channel number where the high-speed counting occurs. The value range is 1 ~ 4. |
| D | The second operand. Entries are only DWORD data registers. This is where the number of counts is stored. The signed value range is -2,147,483,648 ~ 2,147,483,647 (232). |
Notice
Error Flag (F11.0) Notice
The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.
Instruction Behavior
The HSC instruction behaves as follows:
- The instruction only counts up.
- Counting down is not available with this instruction.
- Please refer to the HSCSW instruction for counting down.
- Counting down is not available with this instruction.
- When the enable signal is OFF, the number of counts does NOT increase in any case.
- When the enable signal goes from OFF to ON and there are input pulses from the terminal of the channel, Ch, the number stored in the data register D increases from the latest value.
- When the preset signal turns ON, the internally preset value replaces the value stored in the data register D.
Ladder Diagram Examples
HSC

The HSC instruction counts up the pulses from the terminal of the channel, Ch, and accumulates the number of pulses in the assigned DWORD data register D.

When the contact, M0.0, is powered ON (1), the HSC instruction counts up, saving the current count in the data register, D0.

