Panasonic FP Series Programming Manual page 899

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

High-speed counter instructions
Interrupt operation
The interrupt program will be executed when the elapsed value matches the target value. Any
interrupt that has been entered into the Tasks list is automatically enabled. A special interrupt
program number is assigned to each channel number.
Channel
Interrupt program
General programming information
Select the high-speed counter input for the desired channel in the system
registers.
When a high-speed counter instruction is executed, the high-speed counter
control flag (e.g. sys_bIsHscChannel0ControlActive) for the channel used turns
to TRUE. No other high-speed counter instruction using the same channel can
be executed as long as the control flag is TRUE.
To cancel execution of an instruction, set bit 3 of the data register storing the
high-speed counter control code (sys_wHscOrPulseControlCode) to TRUE. The
high-speed counter control flag then changes to FALSE. To re-enable execution
of the high-speed counter instruction, reset bit 3 to FALSE.
Rewriting the elapsed value for the channel used during the execution of the
instruction may cause an unexpected operation.
Make sure the time span between adjacent target values is greater than 1ms.
If the instruction is executed in the main program, make sure the minimum time
span between adjacent target values is greater than the scan time.
If the instruction is executed in an interrupt program, make sure the minimum
time span between adjacent target values is greater than the maximum execution
time of the interrupt program.
This instruction can be executed simultaneously on a maximum of two channels.
When using a reset input or a software reset, make sure target value 1 is an
integer and  1.
When maximum target value control is used together with a reset input or
software reset, be careful not to use them at the same time.
The status of the high-speed counter control flag or pulse output control flag may
change while a scan is being carried out. For example, if the flag is used more
than once as an input condition, different statuses may exist within one scan. To
ensure proper execution of the program, the status of the special internal relay
should be copied to a variable at the beginning of the program.
PLC types: Availability of F165_HighSpeedCounter_Cam (see page 1322)
Data types
Variable
iHscChannel*
s_dutDataTable
dutBitOutputs
898
0
1
2
3
0
1
3
4
Data type
Function
INT
High-speed counter channel: 0–5
ANY_DUT
Starting address of area containing the data table
Sample: F165_HighSpeedCounter_Cam_8_Values_DUT
ANY_DUT
Starting address (WR) of area containing the word address for the output
relays, e.g. BOOL32_OVERLAPPING_DUT. Select the size (16 or 32
bits) according to the number set with
diNumberOfTargetValuesAndOutputRelays.
4
5
6
7

Advertisement

Table of Contents
loading

Table of Contents