The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
Ch
D

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
ChThe 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.
DThe 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.
  • 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 registe

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.

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

Ladder Diagram Example for MapleLogic HSC instruction.