- I am using LV2018 SPI with a PXIe-6363 multipurpose DAQ module.
- I have setup an AI task in NI MAX with 9 differential inputs and 7 RSE inputs, continuous acquisition mode.
- I have created a VI on a timed loop with a period of 1190us. This timing is required to sync my system with the communications system of the UUT.
- When I set the acquisition rate up to 7.2kHz, the system acquires the number of samples I would expect each iteration of the timed loop.
- When I set the acquisition rate higher than ~7.2kHz, the system acquires data in sets that are multiples of 16. At 8.4kHz, the system alternates between acquiring 16 data sets and 0 data sets each iteration. At 16.8kHz, the system alternates between acquiring 32 and 16 sets per iteration. As I increase the acquisition rate, the system increases the number of sets it acquires each iteration, but only in multiples of 16.
- If I remove 2 channels from the task, leaving 14, the system acquires 10 data sets each iteration with the acquisition rate set at 8.4kHz.
- I suspect I am running into a hardware limit, but I have not been able to quantify it yet. If anyone has insight into my situation, please let me know. I wish I could post my code, but I am prohibited from doing so. Thanks very much.
why do you need a timed while loop at all?
Why don't you set a sample rate with your DAQmx tasks?
- I do set up the acquisition rate in NI MAX, at 8.4kHz
- The timed loop is to sync serial comms with the UUT at 840Hz (hardware defined). I include DAQ input in the same loop to sync it with the serial data I get from the UUT.
Hard to diagnose without code, but I understand you can't post it.
Just guessing here.
The base clock is 20MHz for the device, the sample rates you want, 7.2kHz and others, are not possible with this base clock. Your sample rate is being coerced to something slightly different. This may lead to funny things if you assume the timing is exact.
I suggest get rid of the timed loop and use an event instead. Look at the Continuous voltage with events example. Set up the event structure to acquire the points you need for each loop.
Yeah, I'm working through this one step at a time.
Everyone keeps telling me to use a hardware trigger to sync the AI data, but I am trying to sync with serial data, so I am not sure how to incorporate a hardware trigger in the system. Any suggestions?
I quickly reviewed this thread and the one I linked.
1. The behavior you describe in msg #1 of this thread sounds odd and unexpected. I'm not exactly sure what you mean by "data sets", and without code it's difficult to speculate further.
2. You have either 2 or 3 things competing to control your loop timing and keep your data in sync.
The correct number would be 1 and only 1.
I would probably choose the serial stream (assuming you can enable the termination character and let VISA Read block while waiting for the next line). Then I'd use a regular While Loop instead of a Timed Loop. I'd add sequencing to call DAQmx Read *after* the VISA Read. And I would wire a -1 to the DAQmx Read call to request "all available samples". Nominally, you'll kinda expect to get the same # of samples with each read. Actually, you'll see it vary by at least +/- 1.