Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6601 adding timer

 

Hi yatintyagi,

 

 

The counter is counting the data received in the counter source terminal. If in this case you are not doing a buffered acquisition, like in your other post, then the counter will be operating as the top figure in the Edge Counting Help, just counting the edges.

Ana P
National Instruments
Applications Engineer
0 Kudos
Message 11 of 16
(1,173 Views)
Hi again,

Sorry abt so many questions. Smiley Happy but actually i think i understand now.

In buffered edge counting the data input is updated every inc edge (if set so) of the sample clock i.e. it is updated every 50 ns (20 Mhz Timebase). Now comes the part of getting the count in labview in the while loop.

So, if I set the acquire data task in a while loop with timeout equal to zero , one loop would be equivalent to one clock pulse. There would be no other time lag would there because what I need is the Counts between two sample clock pulses and the total count too? So, if I take the difference of two successive data counts then that would be equivalent to the count per pulse.

Thanks,
Yatin

PS: what does the no. of samples mean?
0 Kudos
Message 12 of 16
(1,157 Views)
Hi yatintyagi,

First off, number of samples indicates how many samples you want to acquire each time the read function is called.  You can read more from the LabVIEW Help.  In the Contents tab, navigate to: VI and Function Reference » Measurement I/O VIs and Functions » DAQmx - Data Acquisition VIs and Functions » DAQmx Read. 

The way buffered acquisition works, is you bring in a chunk of samples from hardware to your LabVIEW environment one iteration at a time.  If you set your timeout to zero, DAQmx Read tries once to acquire the number of samples you have specified.  If these samples are not available, then an error is generated. 

Please note that the loop execution is still dependent on your system.  DAQmx Read is still a software call, so the only way to control the execution speed of your loop is to put in a wait (assuming your using Windows).
I highly recommend taking a look at these two links to better understand how DAQmx is working here.

Buffered Event Counting

Getting Started with DAQmx

Rod T.
0 Kudos
Message 13 of 16
(1,139 Views)
Hi,

Yeah that was my point too.. Since it is a software call the time might be  a problem..  So, what i thought for this was to count the number of pulses on the sample clock (using the 20 Mhz one i.e. 50 ns). So multiplying this with 50 ns gives me the time..this is what i read here.. So, can what it says be implemented..

I had one more doubt .. suppose i use buffered count edges and have a timeout of 0.. so would one read to another mean one sample clock pulse...

Attached here is the vi i intend to use.



0 Kudos
Message 14 of 16
(1,128 Views)



Message Edited by yatintyagi on 06-10-2008 03:11 AM
0 Kudos
Message 15 of 16
(1,128 Views)
Hi yatintyagi,

Just to clarify, setting the timeout to zero will have no effect on how fast your loop will iterate (one read to the next).  As you said, the counter will count each rising edge of the sample clock.  This count is stored in the hardware memory.  Every time DAQmx Read is called, it pulls this data from the hardware memory.  By setting the number of samples to 5, you are telling DAQmx Read to pull 5 samples from the hardware memory each time it’s called. 

Say for example, you have 3 available samples in the hardware memory.  If you have set your samples to read to 5 and your timeout to 0 you will receive an error.  The reason being is that once DAQmx Read is called, there needs to be 5 samples ready at that instant (if you set your timeout to 0).  If you set your timeout to 5 seconds, it will wait a MAXIMUM of 5 seconds for the number of samples you have set to be ready in the hardware memory.  You can set your timeout to as large as you want, but once 5 samples are ready then DAQmx Read is finished.

Thus, the time between reads depends on your sample rate and number of samples.  This is ok though, because even if your time between reads is not one sample clock pulse, the count is being stored in the hardware memory.  Every time DAQmx Read is called, it will give you an updated count.  Let me know if this makes sense.     
Rod T.
0 Kudos
Message 16 of 16
(1,100 Views)