Chapter 3 Counter function of the PI918
6F8C1370
20
3.2.2. Application as a speed counter with alarm
Itcanbeusedformeasuringtheexternalpulseinputfrequency.Ifan
alarmisset,theinterruptstatusisinversedwhenCountvalueAlarm
valueduringthesamplingcycle.
Condition:
Parameter
setting
EP AL SP SV
1 1 1 0
External
input
Pulseinput Gateinput
Externalpulseconnection Invalid
Operation:
(1) Thecountvalueofexternalpulsesistransferredtothehold
registeratthesamplingcycles.
(2) TheinterruptstatusisinversedwhenCountvalueAlarmvalue
duringthesamplingcycle.
Theinterruptstatuscanbeinversedatcertaincyclesonlywhen
inputpulsesaredetectedandthetotalinputpulsescanbe
countedbasedontheintegralvalueforeachinterruptbysetting
thealarmvalueto"1." Foranoverflow,aninterruptoccurs
immediately.
(3) Theholdvalueisnotguaranteeduntilthetimeuptotwotimesthe
samplingcycleelapsesafterstartup.
Figure 3.2.2. Example of speed counter with alarm operation
Externalinputpulse
Countvalue
0
Startup(parameter
downloadcomplete)
Sampling
A
B
T
Holdvalue
0
2T(max.)
(Indefinite
A
D
C
E
F
B
C
D
E
F
Interruptstatus
Alarmvalue(1to32768)
Overflo
(Synchronous
inversion)
(Asynchronous
inversion)