3-28
|
ni.com
Chapter 3
Counter Input
Timing Settings
The timing settings determine when the device reads the encoder.
On-Demand
By default, the counter uses On-Demand (no sample clock) timing. The counter starts counting
when software calls DAQmx Start Task. Each time software calls DAQmx Read, the NI 6614
returns the current angle of the encoder. Figure 3-32 shows an example of On-Demand timing.
Figure 3-32.
Angular Position: On-Demand Timing
Sample Clock
To precisely control when the device reads the encoder, use the DAQmx Timing (Sample Clock)
vi or function. With this vi or function, you can set the source and rate of the Sample Clock and
the number of samples to acquire.
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-33 shows an example of Sample Clock timing.
Figure 3-33.
Angular Position: Sample Clock Timing
A
B
Co
u
nt
0
1
3
4
5
6
2
Re
a
d
V
a
l
u
e
DAQmx
S
t
a
rt T
as
k
DAQmx
Re
a
d
DAQmx
Re
a
d
2
5
A
B
Co
u
nt
0
1
3
4
5
6
7
8
2
B
u
ffer
DAQmx
S
t
a
rt T
as
k
Sa
mple
Clock
3
3
6