31.5.6.5 Preload (Change Value) - High Speed Counter (Single-phase Settings)

Preload is a function for writing the high-speed counter's current value with the defined value. The write operation uses input signals (preload input) from external terminals or the #L_ExIOCntInExtCtrl system variable.

A: Preload input or trigger bit for #L_ExIOCntInCtrl system variable's write operation

PLV: Preload Value

Summary

In GP-Pro EX, you can set up the initial preload value. When the system is running, you can change the preload value with system variables or the HSCX logic instruction. The following describes the steps when using a system variable.

The following explains how to set up Preload (Change Value) and explains its operation after the system is running.

Setting Up Initial Values

Refer to "Setup Process in GP-Pro EX".

 

Writing to the preload value

  1. Write to preload value with external input or #L_ExIOCntInCtrl system variable.

  2. Check the result of the write operation.

 

Changing setup value after system is running

  1. Set the preload value in the system variable #L_HSC*_PLV

  2. Set the #L_ExIOSpParmChg system variable's [Request Special I/O Parameter change] parameter

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

Set Up Process in GP-Pro EX

LT3000 Series / STC6000 Series

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

  2. Click [High Speed Counter Settings] and set the [Preload Value (PLV)] in the dialog box that appears.

 

LT4000 Series

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

  2. In [Preload Value (PLV)] specify the preload value.

 

Writing to the preload value

To write the high speed counter value to the preload value, you can use either input terminal signals or system variable (#L_ExIOCntInCtrl).

Write using terminal input signal

Write to the preload value by turning the input terminal signal, defined in the [I/O Driver] dialog box, ON or OFF.

#L_ExIOSpCtrl a: High Speed Counter Control Bit

PLV: Preload Value

#L_HSC*_HCV: Current Counter Value

X1: External input (preload input signal)

 

#L_ExIOCntInExtCtrl
 a: Preload operation complete bit
 e: Preload completion acknowledged bit

1) Turn ON the high speed counter control bit (a) in the #L_ExIOSpCtrl system variable to start the counter.

2) When preload input (X1) turns ON, preload value (100) is written to the counter value (#L_HSC*HCV).

3) When the write operation is completed, the preload operation complete bit (a) in the #L_ExIOCntInExtCtrl system variable turns ON.

4) Turning ON the preload completion acknowledged bit (e) in the #L_ExIOCntInExtCtrl system variable causes the preload operation complete bit (a) to turn OFF. The preload operation complete bit (e) does not turn OFF automatically.

System variable to control and check the status of the extended input (preload/prestrobe/marker) for high-speed counter and 2-phase counter.

 

Bit Number

Feature

Type

Description

Display Unit

LT4000

LT3000/STC6000

a

4(n-1)+0

Preload operation complete

Status

Turns ON when you use the preload input as the trigger and write the preload value to the current value.

This bit turns OFF when you turn ON the preload completion acknowledged bit (e).

e

4(n-1)+16

Preload completion acknowledged

Control

Up

Confirm the preload operation complete bit (a) is ON, and then turn ON this bit.

* To find the bit number associated with each CH, calculate by replacing "n" with the CH number.

 

Write using system variables

Turn ON the preload request bit ON in the #L_ExIOCntInCtrl system variable to write to the preload value.

#L_ExIOSpCtrl a: High Speed Counter Control Bit

PLV: Preload Value

#L_HSC*_HCV: Current Counter Value

 

#L_ExIOCntInCtrl
 c: Preload request bit
 g: Preload operation complete bit

1) Turn ON the high speed counter control bit (a) in the #L_ExIOSpCtrl system variable to start the counter.

2) When the preload request bit (c) in the #L_ExIOCntInCtrl system variable turns ON, the preload value (100) is written to the current counter value (#L_HSC*HCV).

3) When the write operation is completed, the preload operation complete bit (g) in the #L_ExIOCntInCtrl system variable turns ON.

4) After confirming the write operation is complete, turning OFF the preload request bit (c) in the #L_ExIOCntInCtrl system variable causes the preload operation complete bit (g) to also turn OFF.

System variable for running and confirming high-speed counter operations. The bits that are used differ depending on the CH mapped to the high-speed counter.

 

Bit Number

Feature

Type

Description

Display Unit

LT4000

LT3000/STC6000

c

4(n-1)+2

Write to preload value

Control

Up

Writes the preload value to the high-speed counter's current value.

This bit turns OFF when you turn ON the write completion acknowledged bit (e).

g

4(n-1)+19

Write complete acknowledged

Status

When using write to preload value bit (c) as the trigger, this bit turns ON when write operation is complete.

* To find the bit number associated with each CH, calculate by replacing "n" with the CH number.

 

Changing the preload value after the system is running

To change the preload value from the display unit, write the preload value to the #L_HSC*_PLV system variable, and use #L_ExIOSpParmChg to change the parameter.

1) Write the preload value (200) to the system variable #L_HSC*_PLV.

2) Turn ON the request special I/O parameter change bit (a) in the system variable #L_ExIOSpParmChg to write to Special I/O's preload value (PLV).

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.

 

Request Special I/O Parameter Change (#L_ExIOSpParmChg)

 

Bit Number

Feature

Type

Description

Display Unit

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.

g

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.

* To find the bit number associated with each CH, calculate by replacing "n" with the CH number.