Skip to main content

Count Up

Instruction Parameters

Supported PLC Series

XPnA/1RXPnBXPnEXPnFCP3A/B/P/U
CP4A~D/U
CPnECPnFBPPLC-S
--------

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.

Examples