02-10-2015 11:09 AM
Hello everybody, I am developing a test application in VB 2010 with the following configuration:
- NI cDAQ 9184 rack
- NI-9205 32 analog inputs module
I tried the example AcqVoltageSamples_IntClk in which a finite number of samples is acquired. I discovered that the operation
Dim data() As AnalogWaveform(Of Double) = reader.ReadWaveform(samplesPerChan)
instead of lasting about (number of samples / sampling frequency) takes something like (number of samples / sampling frequency) + 300 ms.
I suppose that the 300 ms are needed for starting and stopping the task but for me this is unacceptable because my application consist of a sequence of steps in which I put the device under test in some condition and I take 100 samples at 5 kS/s. This correspond to 20 ms and I cannot loose 320 ms every time.
My 1st question then is: is it possible to start the task when the application starts and then do several reads of a FINITE number of samples? I tried but the 2nd time that I call the ReadWaveform methods it generates an exception.
I even tried in a different way. When the application starts I create and I start a continous sampling task that fills a buffer at 5 kS/s. Then, for example, I do a sequence like this:
1) put 1 V on analog input 1
2) empty the buffer
3) wait for the sample count to be >= 100
4) read and treat the samples
Point 1 is done through an electronic switch so I can consider it instantaneous. Even this solution does not work in fact I always get samples to 0 V. If I add a 50 ms delay between point 1 and point 2 it works i.e. I get samples to 1 V so it seems that the first 100 samples put in the buffer were sampled before the moment in which I emptied the buffer.
My 2nd question then is: what is going wrong? How do I manage a scenario like this? I simply have to take several "photographs" of the analog inputs.
Thank you in advance everybody for you polite attention!
02-18-2015 08:27 AM
Dear PB8,
I found a forum that seems to have your issue that it may be useful for you.
http://forums.ni.com/t5/Multifunction-DAQ/9188-200msec-delay/td-p/1703884
Regards,
Valerio