Omron CS1G/H-CPUxxH Instructions Manual page 802

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

High-speed Counter/Pulse Output Instructions
Flags
Example
000000
3-21-4 SPEED OUTPUT: SPED(885) (CJ1M-CPU22/CPU23 Only)
Purpose
• If there is no reason to execute an interrupt task, specify AAAA hex as the
interrupt task number. The range comparison results can be read with
PRV(881) or using the Range Comparison In-progress Flags.
Note An error will occur if the upper limit is less than the lower limit for any one
range.
Name
Error Flag
When CIO 000000 turns ON in the following programming example,
CTBL(882) registers a target value comparison table and starts comparison
for high-speed counter 0. The PV of the high-speed counter is counted incre-
mentally and when it reaches 500, it equals target value 1 and interrupt task 1
is executed. When the PV is incremented to 1000, it equals target value 2 and
interrupt task 2 is executed.
@CTBL
#0000
High-speed counter input 0
Register target comparison table
#0000
and start comparison
D00100
SPED(885) is used to set the output pulse frequency for a specific port and
start pulse output without acceleration or deceleration. Either independent
mode positioning or continuous mode speed control is possible. For indepen-
dent mode positioning, the number of pulses is set using PULS(886).
SPED(885) can also be executed during pulse output to change the output
frequency, creating stepwise changes in the speed.
This instruction is supported by the CJ1M-CPU22/CPU23 CPU Units only.
Label
ER
ON if the specified range for P or C is exceeded.
ON if the same target value is specified more than once in
the same comparison direction for target comparison.
ON if the upper value is less than the lower value for any
range.
ON if the high-speed counter is set for incremental pulse
mode and decrementing is set in the table as the direction
for comparison.
ON if specified for a port not set for a high-speed counter.
ON if executed for a different comparison method while
comparison is already in progress.
D00100
0002
D00101
01F4
D00102
0000
D00103
0001
D00104
03E8
D00105
0000
D00106
0002
Section 3-21
Operation
Two target values
Target value 1: 0000 01F4 hex (500)
Incrementing, Interrupt task number 1
Target value 2: 0000 03E8 hex (1000)
Incrementing, Interrupt task number 2
781

Advertisement

Table of Contents
loading

Table of Contents