31.5.6.1 Change
Counter Format - High Speed Counter (Single-phase Settings, LT
Series)
The counting system can be changed from up-counter to
down-counter, or from down-counter to up-counter while counting.
Switching counting can be set per CH for which you allocate the
counter.
Summary
In GP-Pro EX, you can set up the initial value for each
parameter. After the system is running, you can change parameters
with system variables.
The procedure for changing the counting format is summarized
below.
Setting Up Initial Values
Refer to the setup procedures for GP-Pro EX
Changing After System is Running
-
Set counter operations and transition settings in
[Change Counter Format]
-
Set the parameter under [Request Special I/O
Parameter change].
-
Under [Special I/O Parameter Change Completed],
acknowledge that the parameter has been changed.
-
[Control Special I/O] to execute.
-
See "Special I/O state" for acknowledgment.
-
The [Request Special I/O Parameter Change]
and [Special I/O Parameter Change Completed] operations reflect all
the CH parameters you change.
-
Right after transferring, operations use
parameter values set up in GP-Pro EX. Any restarts, which include
going off-line, reset, and turning power OFF, use stored system
variables as parameters.
Set Up Process in GP-Pro EX
In [System Settings], select [I/O Driver] and click [High Speed
Counter Settings] on the [Internal Driver] screen.
In the [High Speed Counter Settings] dialog box, select the Up
or Down Count radio button in the Counter Operation area.
Set Up Process with System Variables
-
Define the Counter format using the system variable
#L_HSC*_MOD. The system variable name adjusts to match the CH pulse
output to which it's mapped.
-
The system variable (#L_HSC*_MOD) details are as
shown below. Turn 0 bit OFF to count up, and turn it ON to count
down.
Furthermore, turn the first bit to detect an up pulse and turn it
OFF to detect a down pulse.
#L_HSC*_MOD

HSC method
-
For the counting method, change the parameter under
"Request special I/O parameter change".
"Request special I/O parameter change" changes the parameter in the
system variable (#L_ExIOSpParmChg). Then, acknowledge the
completion under [Special I/O parameter change completed].
Depending on the CH to which you allocate the parameter, the
request flag and the completion flag will have different bit
positions.
#L_ExIOSpParmChg

Request Special I/O Parameter Change
This variable uses the CH specified in the I/O driver settings
as the 4-bit configuration information to request the special I/O
parameter change.
a: CH1 special I/O parameter change
request
c: CH2 special I/O parameter change request
e: CH3 special I/O parameter change request
g: CH4 special I/O parameter change request
You can also read the previous settings using the Operation bits
below.
b: CH1 special I/O parameter read request
d: CH2 special I/O parameter read request
f: CH3 special I/O parameter read request
h: CH4 special I/O parameter read request
-
The following illustration describes details about
variables mapped to [Special I/O Parameter Change Completed]. The
monitor bit differs, depending on the CH the high-speed counter is
mapped to .

a: CH1 special I/O parameter change
complete
c: CH2 special I/O parameter change complete
e: CH3 special I/O parameter change complete
g: CH4 special I/O parameter change complete
You can also read the previous settings using the watch bits
below.
b: CH1 special I/O parameter read
complete
d: CH2 special I/O parameter read complete
f: CH3 special I/O parameter read complete
h: CH4 special I/O parameter read complete
-
The figure below shows the flag timing chart for
the special I/O parameter change request and completion.

1) Configure settings for counting and
edge.
2) Turn ON the request flag for the special I/O parameter change to
change the parameter.
3) Once the parameter is changed, the completion flag turns ON.
4) Acknowledge that the completion flag is ON and turn the request
flag OFF.
5) When the request flag is recognized as OFF, the completion flag
turns OFF.
|