02-25-2016 02:40 PM
I have a system with a microcontroller that controls the analog measurment and send trigger signal out whenever it is capturing the measurment, the trigger pulse width is predifenied. then a NI Digital card acquire this analoge input and convert it to digital and save it to a file.
I used to have a NI-usb6008 to acquire the measurment, the problem was I could not make measurment faster than every 250 msec, otherwise the USB-6008 would miss the trigger signal and would not capture all the data points that I was sending to it (which is 24 data point), but at 250 msec I never missed any data point and the sampling rate was at 3300 sample per second on my DAQ (which is the max for 3 channels.)
I started improving the system and bought a PXIe-6363 which is more accurate and much faster, but even at 250 msecI am randomly missing some datapoints, is there anything that I need to change if I want to use the PXIe-6363?
here is part of my code ( I did not change any of it from USB-6008)
02-25-2016 02:57 PM
if you place DAQmx -> Task Config -> Control Task vi with commit before Start task, then loop not the whole thing, but start - read - stop, then you can get ~5 ms period, not 250 ms with all 3 of these boards.
Also why do you need to set up buffered read, if you are reading one sample?
And PCIe-6363 (or PXIe-6363) has retrigger! You can loop only read without restarting task below 1 ms.
02-25-2016 03:01 PM - edited 02-25-2016 03:02 PM
Even better: use your PFI0 as a clock source, not trigger and continuous acquisition with 10 points buffer. Just read in the loop.
Then it will sample one point on clock edge, put it into the buffer, wait for one point. If you will be triggering fast enough, boards will be able to work at their full speed, you can get back to 6008.
02-25-2016 05:04 PM - edited 02-25-2016 05:06 PM
Thanks for your response.
Let me explain the situation better:I have 24 measurments that I send a trigger signal for each of them to be able to distiguish which data point belongs to which sensor, the trigger signal stays high for 125msec (which I want it to be narrower) while my Analoge output for that specific point is sending the measurement out for 250 msec, the trigger signal turns high at the center of the measurment pulse which means I start making measurment on sensor 24, then wait 125msec turn the trigger on, and keep it on for 125 msec, then turn trigger signal low and switch my measurment circuit to the next sensor and repeat this 24 times( I have 24 sensor). This trigger and measurment pulse width should be as small as possible so I can measure these 24 sensors as quick as possible (desirably all 24 points in 1 second). then I repeat this measurment for X seconds (for example 60 seconds) so at the end of the day I have multiple sets of 24 datapoints for 60 seconds of overall measurment, each of these 24 datasets are separated by 5 seconds.
I did as you said, and collected a lot of data point in less than a seconds (more than 24) which shows that it is not collecting the right data.I guess it is collecting multiple data point within the time that the trigger is high.