31.5.6.7 Synchronize Output - High Speed Counter (Single-phase Settings)

Synchronize output turns either ON or OFF when the current counter value exceeds the preset value. To use the synchronise output function, you need to turn on the #L_ExIOSpCtrl system variable's [Synchronize Output Control] bit.

The timing for changing synchronize output ON or OFF differs between the LT3000 Series or STC6000 Series and LT4000 Series.

Synchronize output operation

ON Preset Value / OFF Preset Value

Overview

Set Up Process in GP-Pro EX

How to change preset values

Request Special I/O Parameter Change

Preset value error status

Synchronize output control

Synchronize output status

Output clear during synchronize output

Synchronize output terminal status

Synchronize output operation

This section explains synchronize output and the operation of system variables that control synchronize output.

Counter mode is [Ring], counter operation is [Up Count], ON preset value is "-100", and OFF preset value is "100".

#L_ExIOSpCtrl_a: High Speed Counter Control Bit

#L_HSC*_HCV: Current Counter Value

#L_ExIOSpCtrl_b: Synchronize Output Bit

#L_ExIOCntInCtrl_b: Synchronize Output Clear Request Bit

y0: Synchronize Output Signal

Synchronize output is turns ON or OFF when the current counter value exceeds the preset value. Using system variables, you can force synchronize output to turn OFF.

1) Turning ON the high speed counter control (#L_ExIOSpCtrl_a) starts the counter. Synchronize output (y0) remains OFF.

2) Turning ON synchronize output (#L_ExIOSpCtrl_b) enables the synchronize output function.

3) After the current counter value (#L_HSC*_HCV) reaches 100 and matches the OFF preset value, synchronize output (y0) turns OFF when the current counter value becomes 101. If synchronize output is OFF, its status remains OFF.

4) After the current counter value (#L_HSC*_HCV) reaches -100 and matches the ON preset value, synchronize output (y0) turns ON when the current counter value becomes -99. If synchronize output is ON, its status remains ON.

5) Turning OFF synchronize output (#L_ExIOSpCtrl_b) turns OFF synchronize output (y0). Even if synchronize output is set ON, synchronize output remains OFF.

6) Turning ON the synchronize output clear request (#L_ExIOCntInCtrl_b) turns OFF synchronize output (y0). Even if synchronize output clear request is turned OFF, synchronize output remains OFF.

7) If you change the current counter value at the moment the current counter value and OFF present value are equal (100), the value of synchronize output (y0) does not change.

Synchronize output changes based on a comparison between the current counter value and the preset value. Using system variables, you can force synchronize output to turn OFF. Even if you enable synchronize output in the middle of counting, or when the current counter value has changed, the value of synchronize output (ON/OFF) is determined based on a comparison at the time of the change between the current counter value and each preset value.

1) Turning ON the high speed counter control (#L_ExIOSpCtrl_a) starts the counter. Synchronize output (y0) remains OFF.

2) Turning ON synchronize output (#L_ExIOSpCtrl_b) enables the synchronize output function. Synchronize output (y0) turns ON as the current counter value is between the ON preset value (-100) and OFF preset value (100).

3) When the current counter value (#L_HSC*_HCV) equals the OFF preset value (100), synchronize output (y0) turns OFF.

4) When the current counter value (#L_HSC*_HCV) equals the ON preset value (-100), synchronize output (y0) turns ON.

5) Turning OFF synchronize output (#L_ExIOSpCtrl_b) turns synchronize output (y0) OFF. When you turn synchronize output ON, the synchronize output value (ON/OFF) is determined by the current counter value and preset value.

6) While synchronize output clear request (#L_ExIOCntInCtrl_b) is ON, synchronize output (y0) is OFF.

7) When the current counter value (#L_HSC*_HCV) equals the OFF preset value (100), synchronize output (y0) turns OFF.

ON Preset Value / OFF Preset Value

Depending on the ON preset value and OFF preset value, synchronize output is as follows.

ON Preset < OFF Preset

OFF Preset < ON Preset

 

#L_HSC*_HCV: Current Counter Value

A: ON Preset

B: OFF Preset

y: Synchronize output

Overview

The following explains how to set up synchronize output and how to change the preset value after the system is running. You can change each preset value with a system variable or logic command. The following explains how to change using a system variable.

Setting Up Initial Values

  1. Turn ON synchronize output in GP-Pro EX

  2. Set each preset value

Changing After System is Running

  1. Set the ON preset value in the system variable #L_HSC*_ONP, set the OFF preset value in #L_HSC*_OFP

  2. Run the the system variable's (#L_ExIOSpParmChg) request special I/O parameter change.

  3. Check that the parameter has changed using the system variable's (#L_ExIOSpParmChg) special I/O parameter change completed flag.

  4. Enable synchronize output in the system variable's (#L_ExIOSpCtrl) synchronize output setting.

  5. Check the synchronize output status in the system variable #L_ExIOSpCtrl.

Setting up in GP-Pro EX

To use synchronize output, enable synchronize output in GP-Pro EX and define the preset values.

  1. From the [Project] menu, point to [System Settings] and click [I/O Driver]. On the [Internal Driver 1] tab, select the [Match] check box and click [High Speed Counter Settings].

  2. In the [High Speed Counter Settings] dialog box, begin set up from [Synchronize Output].

  3. LT4000 Series

  1. From the [Project] menu, point to [System Settings] and click [I/O Driver]. Select [High Speed Counter] in [Function].

  2. Select [Synchronize Output], and specify the [ON Preset Value] and [OFF Preset Value].

How to change preset values

You can change preset values with system variables and logic commands. The following explains how to change using a system variable.

1) Write the ON preset value in the system variable #L_HSC*_ONP and write the OFF preset value in #L_HSC*_OFP.

2) Turn ON the request special I/O parameter change bit (a) in the system variable #L_ExIOSpParmChg to overwrite Special I/O's ON Preset Value (NPV) and OFF Preset Value (FPV).

3) After overwriting the special I/O parameter, the special I/O parameter change completed bit (e) in the system variable #L_ExIOSpParmChg turns ON.

4) After confirming the write is complete, the request special I/O parameter change bit (a) turns OFF. Once the request special I/O parameter change bit turns OFF, the special I/O parameter change completed bit (e) also turns OFF.

5) Turns ON the special I/O parameter read request bit (b) in the system variable #L_ExIOSpParmChg, and reads in the current ON preset value and OFF preset value to the system variables #L_HSC*_ONP and #L_HSC*_OFP.

6) After reading the special I/O parameter, the system variable's (#L_ExIOSpParmChg) special I/O parameter read completed bit (f) turns ON.

7) After confirming read is complete, the special I/O parameter read request bit (b) turns OFF. Once the special I/O parameter read request bit turns OFF, the special I/O parameter read completed bit (f) also turns OFF.

Request Special I/O Parameter Change

#Ex_IOSpParmChg

 

Bit Number

Feature

Type

Details

LT4000

LT3000/STC6000

a

4(n-1)+0

Request Special I/O Parameter Change

Control
Up

Rewrites the special I/O value. Writes the value set up in the system variable to the special I/O parameter.

b

4(n-1)+1

Special I/O parameter read request

Control
Up

Reads the special I/O parameter value to the system variable.

e

4(n-1)+16

Special I/O parameter change completed

Status

Turns ON after the parameter change associated with bit (a) is complete.

Turning OFF bit (a) also turns this bit OFF.

f

4(n-1)+17

Special I/O parameter read complete

Status

Turns ON after the parameter read associated with bit (b) is complete.

Turning OFF bit (b) also turns this bit OFF.

Preset value error status

It shows any error status in the ON preset value and the OFF preset value during the synchronize output. If the system variable (#L_IOStatus[1]) shows the error code 100, you can acknowledge the error status from the system variable (#L_ExIOSpParmErr) value. The watch bit will differ, depending on the CH to which you allocate the high-speed counter.

#L_ExIOSpParmErr

a: CH1 counter preset value error

[1]: Preset value error

[0]: Normal

b: CH2 counter preset value error

[1]: Preset value error

[0]: Normal

c: CH3 counter preset value error

[1]: Preset value error

[0]: Normal

d: CH4 counter preset value error

[1]: Preset value error

[0]: Normal

e: Counter input control error

[1]: Preset value control error (bottom 16 bits in preset value is FFFFh or 0000h)

[0]: Normal

Synchronize output control

Use this function to enable or disable the synchronize output. Turn on the synchronize output flag under the CH special I/O control in the system variable (#L_ExIOSpCtrl) to enable and turn the flag off to disable the output. The Operation bit will differ depending on the CH to which you allocate the high-speed counter.

#L_ExIOSpCtrl

Turn on the 1st bit of the CH to enable and turn it off to disable the output.

Synchronize output status

This function shows whether the synchronize output is enabled or disabled. You can confirm the status (enable/disable) of synchronize output with the synchronize output flag in the #L_ExIOSpCtrl system variable's CH special I/O state. If the flag is ON, output is enabled. If OFF, output is disabled. The watch bit will differ, depending on the CH to which you allocate the high-speed counter.

#L_ExIOSpCtrl

If the 1st bit of the CH is 1, the synchronize output is enabled. If it is 0, the output is disabled.

Output clear during synchronize output

Use this function to turn OFF the output during the synchronize output. You can also acknowledge the synchronize output being cleared.

You can use the synchronize output clear feature whether the counter is ON of OFF. Turn On the synchronize output clear flag under the CH counter input control request in the system variable (#L_ExIOCntInCtrl) to turn OFF the synchronize output. The Operation bit will differ depending on the CH to which you allocate the high-speed counter.

#L_ExIOCntInCtrl

Counter input control request

Turn ON the 1st bit of the CH to turn OFF the output.

The following figure shows the flag timing chart for the synchronize output and the synchronize output clear.

Counter input control response

If the 1st bit of the CH is 1, the synchronize output has been cleared.

Synchronize output terminal status

You can acknowledge the synchronize output status in the output terminal with the system variable (#L_ExIOSpOut). The watch bit will differ, depending on the CH to which you allocate the high-speed counter.

#L_ExIOSpOut

a: CH1 output state

[1]: Output, [0]: Not output

b: CH2 output state

[1]: Output, [0]: Not output

c: CH3 output state

[1]: Output, [0]: Not output

d: CH4 output state

[1]: Output, [0]: Not output