LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Input Limitations

- 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.

Forbes Black
Lapsed CLAD, LV 2018
0 Kudos
Message 1 of 7
(274 Views)

Hi Forbes,

 

why do you need a timed while loop at all?

Why don't you set a sample rate with your DAQmx tasks?

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 7
(265 Views)

- 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.

 

Forbes Black
Lapsed CLAD, LV 2018
0 Kudos
Message 3 of 7
(249 Views)

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.

 

mcduff

Message 4 of 7
(244 Views)

I *thought* this sounded familiar, and sure enough...

 

 

-Kevin P

0 Kudos
Message 5 of 7
(144 Views)

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?

 

Thanks.

Forbes Black
Lapsed CLAD, LV 2018
0 Kudos
Message 6 of 7
(118 Views)

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.  

  • - a Timed Loop
  • - an intention to stay sync'ed with an external serial stream at 840 Hz
  • - (possibly) reading a fixed # of samples from a DAQmx task at a specific nominal rate

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.

 

 

-Kevin P

Message 7 of 7
(87 Views)