The leader in industrial automation and control solutions

High-Speed Counter for PLC-ES Special Program Parameters

  • The high-speed counter parameters take up 26 WORDs for memory.
  • The memory location can be configured for the M, L, K, and D data registers.
    • Please refer to the configuration page for setup help.
  • The parameters of each channel are allocated from the starting address to the order described in the table below.
    • Unless an item says Read Only, the item can have a value read from or written to that data register.

High-Speed Counter Parameters

CH 1
Offset
CH 2
Offset
ItemConfig.
Value
Config.
Function
MemoryNote
0+26Count ModeH0000Linear CounterWORDRead Only
0+26Count ModeH0001Ring CounterWORDRead Only
+1+27Input Pulse TypeH00002-Phase
2-Multiplication
2-Input
+1+27Input Pulse TypeH00012-Phase
4-Multiplication
2-Input
+1+27Input Pulse TypeH00021-Phase
2-Multiplication
Low Active
+1+27Input Pulse TypeH00031-Phase
2-Multiplication
High Active
+2+28Compare ModeH0000Less Than
<
WORD
+2+28Input Pulse TypeH0001Less Than Equal To
WORD
+2+28Input Pulse TypeH0002Equal To
=
WORD
+2+28Input Pulse TypeH0003Greater Than Equal To
WORD
+2+28Input Pulse TypeH0004Greater Than
>
WORD
+2+28Input Pulse TypeH0005Inclusive
<>
WORD
+2+28Input Pulse TypeH0006Exclusive
><
WORD
+3+29Internal Preset Value-2,147,483,648
~
2,147,483,647
(232)
DWORDLow WORD
+4+30Internal Preset ValueDWORDHigh WORD
+5+31External Preset Value-2,147,483,648
~
2,147,483,647
(232)
DWORDLow WORD
+6+32External Preset ValueDWORDHigh WORD
+7+33Ring Counter Maximum Value-2,147,483,648
~
2,147,483,647
(232)
DWORDLow WORD
+8+34Ring Counter Maximum ValueDWORDHigh WORD
+9+35Compare Maximum-2,147,483,648
~
2,147,483,647
(232)
DWORDLow WORD
+10+36Compare MaximumDWORDHigh WORD
+11+37Compare Minimum-2,147,483,648
~
2,147,483,647
(232)
DWORDLow WORD
+12+38Compare MinimumDWORDHigh WORD
+13+39Compare OutputHFFFFReservedWORD
+13+39Compare OutputH0000Y0010WORD
+13+39Compare OutputH0001Y0011WORD
+13+39Compare OutputH0002Y0012WORD
+13+39Compare OutputH0003Y0013WORD
+13+39Compare OutputH0004Y0014WORD
+13+39Compare OutputH0005Y0015WORD
+13+39Compare OutputH0006Y0016WORD
+13+39Compare OutputH0007Y0017WORD
+14+40Unit Time1 ~ 60,000ms
+15+41Pulse/Rotation1 ~ 60,000pulses

High-Speed Counter Control

CH 1
Offset
CH 2
Offset
ItemConfig.
Value
Config.
Function
MemoryNote
+16+42CounterBit 0Enable: 1
Disable: 0
WORD
+16+42Internal PresetBit 1Preset: 1
No Preset: 0
WORD
+16+42Externaml PresetBit 2Enable: 1
Disable: 0
WORD
+16+42CountBit 3Up: 0
Down: 1
WORDRead Only
+16+42Compare OutputBit 4Enable: 1
Disable: 0
WORDRead Only
+16+42Select RPM/PPSBit 5PPS: 0
RPM: 1
WORD
+16+42Latch CounterBit 6Enable: 1
Disable: 0
WORDRead Only

High-Speed Counter Monitor

CH 1
Offset
CH 2
Offset
ItemConfig.
Value
Config.
Function
MemoryNote
+17+43RPM/PPS
Measured Value
-2,147,483,648
~
2,147,483,647
(232)
+18+44RPM/PPS
Measured Value
+19+45ReservedReservedReservedReserved
+20+46CarryBit 0Carry:
1
No Carry: 0
WORD
+20+46BorrowBit 1Borrow:
1
No Borrow: 0
WORD
+20+46Compare ResultBit 2Result:
1
No Result: 0
WORD
+21+47Current Count Value-2,147,483,648
~
2,147,483,647
(232)
DWORD
+22+48Current Count ValueDWORD
+23+49Input Pulse per Unit Time-2,147,483,648
~
2,147,483,647
(232)
DWORD
+24+50Input Pulse per Unit TimeDWORD
+25+51Error CodeRefer to the Error Code TableWORD

Count Mode

  • Ring or linear counting can be chosen.
    • If the mode is changed from ring to linear or linear to ring while operating, the Counter flag must be enabled again.
      • Until the Counter flag is enabled again, operation will continue with the previous counting mode.
  • If the count mode is switched from linear to ring counting and the current value exceeds the ring counter range, linear counting will operate.

Input Pulse Type

  • 2-Phase encoder input signals are supported.
    • 1-Phase
    • 2-Phase
  • The multiplication type can be selected.
    • 1-Phase
      • 2-Multiplication (Low active)
      • 2-Multiplication (High active)
    • 2-Phase
      • 1-Multiplication
      • 2-Multiplication
      • 4-Multiplication

Compare Mode

  • The compare mode is activated only when the compare output flag is enabled.
  • There are 7 compare modes offered by the high-speed counter.
    • Less than (<)
    • Less than equal to (≤)
    • Equal to (=)
    • Greater than equal to (≥)
    • Greater than (>)
    • Inclusive (<>)
    • Exclusive (><)
  • The result of a comparison can be found in the sequence program under compare output flag.
  • If the output contact at the compare output contact (offset +13 or +39) is specified, the comparison can be directly output as an electrical signal.
Built-in HSC Parameters Compare Mode in MapleLogic

Mode 0 – Less Than (Current Value < Compare Minimum Value)

  • When the currently-counted value is less than the compare output minimum value, the output is turned ON.
  • When the currently-counted value increases and becomes equal or greater than the compare minimum value, the output is turned OFF.
Built-in HSC Parameters Compare Mode Less Than in MapleLogic

Mode 1 – Less Than Equal To (Current Value ≤ Compare Minimum Value)

  • When the currently-counted value is less than or equal to the compare output minimum value, the output is turned ON.
  • When the currently-counted value increases and becomes greater than the compare minimum value, the output is turned OFF.
Built-in HSC Parameters Compare Mode Less Than Equal to in MapleLogic

Mode 2 – Equal To (Current Value = Compare Minimum Value)

  • When the currently-counted value is equal to the compare output minimum value, the output is turned ON.
  • When the currently-counted value changes in relation to the compare minimum value, the output is turned OFF.
Built-in HSC Parameters Compare Mode Equal To in MapleLogic

Mode 3 – Greater Than Equal To (Current Value ≥ Compare Minimum Value)

  • When the currently-counted value is greater than or equal to the compare output minimum value, the output is turned ON.
  • When the currently-counted value decreases and becomes less than the compare minimum value, the output is turned OFF.
Built-in HSC Parameters Compare Mode Greater Than Equal To in MapleLogic

Mode 4 – Greater Than (Current Value < Compare Minimum Value)

  • When the currently-counted value is greater than the compare output minimum value, the output is turned ON.
  • When the currently-counted value decreases and becomes equal or less than the compare minimum value, the output is turned OFF.
Built-in HSC Parameters Compare Mode Greater Than in MapleLogic

Mode 5 – Inclusive (Compare Minimum Value ≤ Current Value ≤ Compare Maximum Value)

  • When the currently-counted value is included between the minimum and maximum compare values, the output is turned ON.
  • When the currently-counted value is not included between the minimum and maximum compare values, the output is turned OFF.
  • It is not necessary to specify the compare value maximum to a value greater than the minimum compare value.
    • Given two values, the PLC internally takes the larger of the two values as maximum and less as minimum.
Built-in HSC Parameters Compare Mode Inclusive in MapleLogic

Mode 6 – Exclusive (Compare Minimum Value > Current Value, Current Value > Compare Maximum Value)

  • When the currently-counted value is not included between the minimum and maximum compare values, the output is turned ON.
  • When the currently-counted value is included between the minimum and maximum compare values, the output is turned OFF.
  • It is not necessary to specify the compare value maximum to a value greater than the minimum compare value.
    • Given two values, the PLC internally takes the larger of the two values as maximum and less as minimum.
Built-in HSC Parameters Compare Mode Exclusive in MapleLogic

Internal Preset Value

  • When the internal preset command (offset +16 or +42) is switched from the reset to set status (0 to 1), specify the currently-counted value as a designated value in this offset.
    • If ring counting and the specified value is out of the count range, the current value will not be modified despite the preset command.
      • Error Code 100 occurs

External Preset Value

  • When the external preset signal (Xn.4 or Xn.6) is changed (contact A) from OFF to ON, the currently-counted value is changed to a designated value in this offset (+5 and +6 or +31 and +32).
    • If ring counting and the specified value is out of the count range, the current value will not be modified despite the preset command.
      • Error Code 100 occurs

Ring Counter Maximum Value

  • When the count mode is set to ring count, 1, the value set in the ring counter maximum value will be taken as the upper limit.
    • The count range of the ring counter is from 0 ~ user-defined maximum value.
  • If the increasing pulses are pulsed when the ring counter reaches the maximum value, the count value will be automatically reset to 0.
    • The carry flag (offset +20 or +45, bit 1) will be set to 1.
  • If the decreasing pulses are pulsed when the ring counter reaches the value of 0, the count will be changed to the ring counter maximum value.
    • The carry flag (offset +20 or +45, bit 2) will be set to 1.

Compare Minimum & Maximum Values

  • The comparison calculation process, that is performed when the compare out flag (offset +16 or +42) is ON, uses the setting value in this offset.
    • Either the compare minimum value (offset +11 and +12 or +37 and +38) only or both the minimum and maximum compare values can be used together.
  • It is not necessary to specify the compare value maximum to a value greater than the minimum compare value.
    • Given two values, the PLC internally takes the larger of the two values as maximum and less as minimum.

Compare Output

  • The carry flag (offset +20 or +45, bit 2) can be used as an internal flag, and it can also be used to output an electrical signal.
    • In order to use this function, one of the outputs from Y0010 ~ Y0017 must be selected.
      • Do not operate the assigned output contact in the sequence program.
  • If there is a duplicate contact used in the sequence program, it may not work properly.
    • *Ensure the compare output flag (offset +16 or +42, bit 4) is ON.

Unit Time

  • Unit time must be ON in order to use and measure rotations per minute (RPM) or pulses per second (pps).
  • If unit time is 0, the RPM and PPS measurement function will not operate.
  • By measuring the pulse count number for a specified period of time and based on the configured values, then the measured pulse count number will be written to the input pulse per unit time (offset +23 and +24 or +49 and +50).
    • The measured value will be updated in the unit time interval.

Pulse per 1 Cycle/Rotation

  • In order to measure rotations per minute (RPM), the offset (+15 or +41) must be configured as a non-zero value.
    • If the value is 0, pulses per second (PPS) will operate in the measurement mode.
      • Error Code 101 will appear regardless of the *RPM/PPS selection (offset +16 or +42, Bit 5).

Counter Operation Setting

  • Select the channel to be used:
    • Channel 1: offset +16, bit 0
    • Channel 2: offset +42, bit 0
  • To enable counting, set bit 0 to 1.

Internal Preset Operation Setting

  • To forcefully set the currently-counted value to a specific value, set bit 1 to 1.
    • Channel 1: offset +16, bit 1
    • Channel 2: offset +42, bit 1
  • When this bit is ON, the current count value (offset +21 and +22 or +47 and +48) is written as this value.
    • It is not possible to use the DMOV instruction to modify the currently-counted value.
      • The built-in high-speed counter only operates to write the internal counter value for every scan.

External Preset Operation Setting

  • To forcefully set the currently-counted value to a specific external value, set bit 2 to 1.
    • Channel 1: offset +16, bit 2
    • Channel 2: offset +42, bit 2
  • The external value comes from an external signal.
    • The signal must be received by the input signal contacts (Xn.4 or Xn.6).
  • The preset setup value must be written to the external preset value (offset +5 and +6 or +31 and +32) before the preset signal is pulsed.

Count Operation Setting

  • The currently-counted value increases or decreases by the input signal direction (phase difference).
  • To count up, offset +16 or 42, bit 3, must be OFF.
  • To count down, offset +16 or 42, bit 3, must be ON.

Compare Output Operation Setting

  • The high-speed counter can output by comparing the currently-counted value to the comparison value.
    • Select 1 of the 7 compare modes to compare the values.
  • If the flag (offset +16 or +42, bit 3), is OFF, the comparison function will not operate regardless of other configurations.

Select RPM/PPS Operation Setting

  • Rotations per minute (RPM) or pulses per second (PPS) are stored in the measured value offset (+17 and +18 or +43 and +44).
  • To enable RPM measurement, set bit 5 to 1:
    • Channel 1: offset +16, bit 5
    • Channel 2: offset +42, bit 5
  • To enable PPS measurement, set bit 5 to 0:
    • Channel 1: offset +16, bit 5
    • Channel 2: offset +42, bit 5
  • For RPM measurement, the pulse/rotation value must be greater than 0.
    • Otherwise, PPS will be measured.

Latch Counter Operation Setting

  • To retain the currently-counted value, even if the power turns off, turn bit 6 to 1.
    • Channel 1: offset +16, bit 6
    • Channel 2: offset +42, bit 6
  • The currently-counted value is stored in non-volatile memory.

RPM/PPS Measured Value

  • The measured value (offset +17 and +18 or +43 and +44) will store the measured rotations per minute (RPM) or pulses per second (pps) value.
  • For RPM measurement, the pulse/rotation value must be greater than 0.
  • Otherwise, PPS will be measured.

Carry Monitor

  • The carry flag (offset +20 or +45, bit 0) will be ON in the following conditions:
  1. When additional pulses (counting up) are detected after reaching the maximum value, 2,147,483,647, while linear counting.
  2. When an additional pulse input is detected at the ring counter maximum value (offset +7 and +8 or +23 and +24).
    • The count value becomes 0 and carry signal occurs.
  3. If condition 2 occurs, the operation will behave as follows:
    • Linear counting: stops the increasing direction count and displays the fixed maximum value.
      • When the decreasing direction pulse is pulsed, the decrementing count works normally.
    • Unit Time: if unit time (ms) is 0, the rotations per minute (RPM) and pulses per second (pps) functions will not operate.
      • Neither count function of the input pulse will operate.
  4. The carry signal will be reset 0 under the following conditions:
    • When the increasing direction pulse is input.
    • When it is forcefully reset by the sequence program.

Borrow Monitor Flag

  • The borrow flag (offset +20 or +45, bit 1) will be ON in the following conditions:
  1. When additional pulses (counting down) are detected after reaching the minimum value, -2,147,483,648, while linear counting.
  2. When an additional pulse input is detected at the ring counter maximum value (offset +7 and +8 or +23 and +24).
    • The count value becomes 0 and borrow signal occurs.
  3. If condition 2 occurs, the operation will behave as follows:
    • Linear counting: stops the increasing direction count and displays the fixed maximum value.
      • When the decreasing direction pulse is pulsed, the decrementing count works normally.
    • Ring counting: currently-counted value will be switched to the ring counter maximum value (offset +7 and +8 or +23 and +24).
      • The normal counting operation proceeds according to the direction of the input pulse.
  4. The borrow signal will be reset 0 under the following conditions:
    • When the increasing direction pulse is input.
    • When it is forcefully reset by the sequence program.

Compare Output Monitor Flag

  • The compare output flag (offset +20 or +45, bit 1) will be ON if the *compare output (offset +16 or +32, bit 4) is ON.
    • The comparison operation with the currently-counted value is performed based on the configured comparison value.
      • The result is written into this flag.
  • When it is configured to output the comparison result as a contact, it indicates the same status as compare output (offset +13 or +29).

Current Count Value

  • This is the currently-counted value.
    • To force this value to change, use the internal preset value or external preset value function.

Input Pulse per Unit Time

  • During the unit time (offset +14 or +30), the number of the input pulse will be recorded.
  • If the unit time (offset +14 or +30) is set to 0, the number of pulses can’t be measured.
    • This flag will also result in 0.

Error Code

CodeError NameDescription
0No ErrorNormal operation mode
100Exceeded Ring Counting RangeCurrently-counted value exceeds the ring counting range
101RPM Operation ErrorWhen the Pulse/Rotation Vyvle is set to 0.