From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

difference between finite and continous operations

Hello All,
  I have a basic question about the finite and continuous AI read VI.
  Please see my attached vi. its function is to read 5 samples and return. The sample clock is a 1KHz external pulse train connected to PFI4. There is also a DAQmx Read Property node to check how many sample available before the DAQmx read vi runs.
  If I choose finite sample mode, the vi completes its execution very fast and the result from DAQmx Read Property node is 5 exactly.
  but if I choose continuous sample mode, the vi takes much longer to complete and the result from DAQmx Read Property node is 512 though I just request 5 samples.
  I just want to make myself more clear about the how DAQmx Read vi runs. my guess is, if you choose continuous mode, then the fetched data won't be available (that means, you only see 0 through the read property node) until certain amount of samples has been acquired, which is 512 in my case. In other word, the continous mode isn't a good way to monitor the data thoughout on the fly.
  Can anybody explain the difference in term of how they perform between two modes?
 
thanks
 
feilong
 
 
 
 
0 Kudos
Message 1 of 10
(7,455 Views)

one more update about my post.

I did another test on counter read operation (counting edge) and found no difference between finite and continous mode. both return very fast and the DAQmx Read Property node return 5 exactly.

It looks like DAQmx treat counter and AI by different ways.

 

0 Kudos
Message 2 of 10
(7,453 Views)
Hi feilong,

There is a significant different between finite and continuous mode when you are timing an acquisition.  When you set the timing to finite, it will only acquire a certain number of samples which is set by the number of samples to read.  Continuous mode specifies to acquire data until the task has been stopped.  In continuous mode, when you set the number of samples to read, it just identifies the buffer size in the computer.  This means it specifies the number of samples that are taken at a time into the computer.  There is a PC buffer in you computer that holds a certain number of samples at a time.  However, with continuous once the samples are acquired, it will just go on and acquire the next number of samples until the task has been stopped.  If you go to the NI DAQmx Help (located at Start>>Programs>>National Instruments>>NI-DAQ), you can search from buffer size and there is a document called "How is the Buffer Size Determined" that might be able to explain this concept a little further. 

At this point, instead of creating your own program, I think it would be better to leverage off of the example programs that National Instruments provides with LabVIEW in order for you to understand the difference in these two modes with analog input and counter measurements.  To get to those example programs, you can go to LabVIEW and go to Tools>>Find Examples and the NI Example Finder will come up.  You will see a folder structure and if you click on Hardware Input and Output>>DAQmx>>Analog Measurements>>Voltage then you will see a lot of examples.  If you click on Acq&Graph Voltage-Ext Clk.vi, this would be a voltage example that uses finite samples.  If you then open up Cont Acq&Graph Voltage-Ext Clk.vi, this is an example that uses continuous mode.  Similarly instead of clicking on Analog Measurements, you can select the folder for Counter Measurements>> Count Digital Events.  There are two examples here as well: Count Digital Events-Buffered-Continuous-Ext Clk.vi uses continuous mode and Count Digital Events-Buffered-Finite-Ext Clk.vi uses finite mode with counters.  Hopefully this information was helpful!
Regards,
Vanessa L.
Applications Engineer
National Instruments
Message 3 of 10
(7,426 Views)
Thanks Vanessa!
 
0 Kudos
Message 4 of 10
(7,419 Views)

Hi Vanessa L

Related about the operation mode of DAQ, I need to acquire the data which is changing very fast so that why I bought a NI card model: USB 6341 X series from National Instrument and I expected high speed acquisition since on the specs they said 500 ks/s that why I chose it.

I am new with Labview and I wrote a simple program for my application that you can see in attached file. I have two inputs, I used Assistant DAQ to acquire the data. all I want is to take the data, put it in a text file, that's all. I chose the "Continuous Samples" mode of DAQ and the speed I saw it just 2Ks/s then I switched to 1 sample (on demand) mode it was even lower. I tested with all modes, the fastest one is Continuous Samples like I mention above but it doesnt sastisfy my application, I need much higher rate.

If you know  how to use the card properly to use up the rate as indicated on the specs.

Many Thanks

 

0 Kudos
Message 5 of 10
(6,804 Views)

All of DAQ settings are hidden by the DAQ Assistant and all that you posted was an image. For high sample rates and continuous mode, you will probably have errors if you are saving to a text file. Are you also doing that? You should be streaming to file in binary or using a producer/consumer architecture.

0 Kudos
Message 6 of 10
(6,797 Views)

You are not likely to get that kind of speed with blue boxes on your block diagram.

 

Go through the example finder and look at the "Voltage (with events) - Continuous Input.vi"  since, you are not likely to get a lot of speed out of a text file either.  TDMS logging will help a lot.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 10
(6,788 Views)

Hi guys,

Thank so much for your quick responds. Here is my IV file. Yes, I did save data in a text file and I got error after around 20 s of measurement if I selected Continuous mode (that chose by right clicking on Assistant DAQ then selected the mode) . I thought that error means it does not have enough memory for the data.

So I can still use the Assistant DAQ with the continuous mode and only change the way to save the data then I can get higher rate?

P/S. My application is to acquire the data just in 1 or 2 second but the switching time very fast so I need as much meaning data as I can. Until now I had only 2 good points, sure that is not enough.

Thanks

0 Kudos
Message 8 of 10
(6,782 Views)

You are only reading 1 sample at a time.  Try reading 100 at a time at the 1 kHz sample rate.

0 Kudos
Message 9 of 10
(6,771 Views)

Try something more like this:

!1.png

to get there I first right-clicked on the DAQmx assistant and selected "Convert to Task"  and configured the task to stream data to disk as it is read.   Then I tosssed out all the rest of the express vis since the DAQmx task does everything you wanted it to do.

 

Edit: Attached backrev saved to LabVIEW 2010 per source vi I do not know if the logging functions work that far back but the conversion did not toss up any warnings. other than the expected " some Polymorphic instances.." of the configure logging vi have required terminals.  So if its broke in 2010 you may need to relink to the correct poly instance


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 10
(6,765 Views)