3-4
|
ni.com
Chapter 3
Counters
On each sample clock, the device stores the current count value in a buffer. Use DAQmx Read
to read the values from this buffer. Figure 3-4 shows an example using Sample Clock Timing.
Figure 3-4.
Edge Counting: Sample Clock Timing
Trigger Settings
By default, the counter:
•
begins counting when software calls DAQmx Start Task.
•
counts every active edge on the input terminal.
•
never resets the count until you call DAQmx Stop Task.
You can change these behaviors by configuring DAQmx Trigger properties.
Using an Arm Start Trigger
Use an Arm Start Trigger to have the counter begin counting in response to a hardware trigger.
1.
Set ArmStart.TrigType to Digital Edge.
2.
Set ArmStart.DigEdge.Src to select what signal to use as the ArmStartTrigger.
3.
Set ArmStart.DigEdge.Edge to select the rising or falling edge of the signal.
Figure 3-5 shows an example of a count edge task using an Arm Start Trigger.
Figure 3-5.
Edge Counting: Using an Arm Start Trigger
3
6
3
S
t
a
rt T
as
k
S
ign
a
l to Me
asu
re
Sa
mple Clock
Co
u
nt
B
u
ffer
1
0
7
6
3
4
5
2
S
t
a
rt T
as
k
S
ign
a
l to Me
asu
re
Arm
S
t
a
rt Trigger
S
o
u
rce
Co
u
nt
1
0
3
2