01-24-2014 09:06 AM
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.
01-26-2014 10:32 AM
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.
01-26-2014 11:03 AM
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.
01-26-2014 11:37 AM
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)?
01-27-2014 01:11 AM
Correct.
01-27-2014 01:19 AM
Thank you. will give it a try 🙂