I am doing a university project which needs to use AD2 to do continuous data aquisition on analog signals.
I have tried 2 libraries: 'Digilent WF VIs' and 'AD2 toolkit'.
I found the 'Digilent WF VIs' seems not having continuous data logging features. And 'AD2 toolkit' cannot measure multiple samples.
Any help would be appreciated! Thanks!
Solved! Go to Solution.
Well continuous data logging is rather vague.
Other than log data forever what are your requirements?
This link (Getting Started with LabVIEW and Analog Discovery 2) makes me think that your best bet will be the Digilent WF VIs.
Probably you'll want to set up some sort of hardware-timed acquisition, and then use a While loop (or two) in LabVIEW (the two would be for some sort of Producer/Consumer architecture) in order to continuously acquire the data.
Try setting up a VI that can read a sample/block of samples from the AD2, and then see if wrapping the Read parts (not initialize/configure or close/shutdown/teardown methods) in a While loop gets you close to what you want.
I tried to use the while loop, but there are sample lost. The gap between each data block is about 0.0083s (Fs:12800/ recording time:0.5s/ measured signal: 50Hz)
As my project needs the local oscilator locked to the waveform measured by AD2, the measurement result can not phase jump. Thanks!
I'll download the driver and take another look, but as an initial guess (without being able to read much about the functions) I'd suggest that either
a) Run should be before the loop, not in the loop?
or b) You have a problem with both being in the same loop. Try creating two parallel While loops, it may be that the timing of one is interfering with the other operation.
So, I suspect I was previously wrong.
I'm no longer sure you can manage what you want (continuous acquisition) using the WF VIs, and I'm fairly certain you can't with the AD2 Toolkit.
However, the SDK manual provided with the driver describes how you could set it up if you're willing to create your own Call Library Function nodes and call the lower-level functions.
You need to use "acqmodeScanShift" or "acqmodeScanScreen" mode acquisitions, which you can configure using the "FDwfAnalogInAcquisitionModeInfo" function.
Looking at the WF VI functions, they are all calls into the same library that you need to use, but they call functions like "niVB_MSO_ConfigureAnalogChannel".
Running dumpbin on the DLL provides a long list of functions (including a sizeable number prefixed by "ni" which are presumably the contents of the WF VIs VI package, and then some "niAcademic_*" functions which I suspect match the AD2 Toolkit functions.
Sorry for the probably frustrating news - but good luck if you decide to continue!
The Diligent waveforms software just upgraded. Now with the new dwf library, continuous data logging is achievable on LabVIEW.
Thank you very much for your information, you gave me a lot of ideas.