Count Up
Instruction Parameters
Supported PLC Series
| XPnA/1R | XPnB | XPnE | XPnF | CP3A/B/P/U CP4A~D/U | CPnE | CPnF | BP | PLC-S |
|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | ✓ | - |
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.