LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number of samples issue with Data Acquisition on a Real Time machine.

I have a simple Data Acquisition program, that runs just fine on my Windows machine.

It consists of a While loop that reads several DAQ parameters (Channel(s), Min and Max values, Sample Rate and Buffer Size) from the Front Panel, runs a sub VI that does the actual DAQ (the specified number of samples at the specified rate).

 

I have tried doing the same thing on a PXI Real Time machine. I've kept the program unchanged, except I'm now passing the Min, Max, Sample Rate and Buffer Size values through variables from an interface VI running on the Windows PC and passing back (also through a variable) the waveform. The program seems to work (values are getting read and passed to the loop on the PXI and a waveform is sent back to the Windows PC) with one caveat: regarldess of Buffer Size, the PXI returns a single data point (the Y array of the waveform contains a single values) instead of N as expected (where N is the Buffer Size).

 

Any idea what went wrong?

 

I've attached pictures of both the main VI running on the PXI as well as the sub VI.

 

PXI VI.png

 

 

subVI.png

0 Kudos
Message 1 of 6
(2,318 Views)

I've been struggling with this all week-end and still no luck.

 

I could also use an example of functional data acquisition VI on a real time machine if anyone has one handy.

0 Kudos
Message 2 of 6
(2,284 Views)

First tip is to not configure the daq task and close the task on every iteration of the while loop.  Configure the task before the loop starts and close it after the loop.  Only stop and configure the task in the event that any of the configuration data changes.

0 Kudos
Message 3 of 6
(2,277 Views)

So, as long as the configuration data wouldn't change (and in case of what I want to do it won't) i should only include the actual write block in the loop (so have the loop between the start and stop blocks)?

0 Kudos
Message 4 of 6
(2,272 Views)

Correct.

0 Kudos
Message 5 of 6
(2,249 Views)

Thank you. will give it a try 🙂

0 Kudos
Message 6 of 6
(2,244 Views)