04-18-2021 02:49 AM
Hello everyone!
I want to make a waveform generator that reads some column in Excel and generates an analog output signal using a scaled version of the data from that Excel column.
The data is read from Excel and the waveform is built and scaled in LabView. Thus far, no problem. When I run the VI and probe the thick red/brown wire, the "dt" is also set correctly. But when I check the analog output signal on an oscilloscope, the total time of the signal is not equal to the given dt * number of datapoints. Therefore, the total output time of the signal is not what I wanted/expected.
In included a screenshot of the part of my code where the created waveform has to be outputted in a correct way.
Can someone please help me? Thank you very much in advance!
Solved! Go to Solution.
04-18-2021 06:23 AM
In your code you stop the generation task immediately after starting it.
If this is a finite generation task, a simple fix is to insert "DAQmx Wait Until Done" between the start and the stop. If it's continuous, you'll need to wait some other way, perhaps a loop. Have a look at the shipping examples
-Kevin P
04-18-2021 01:16 PM
Indeed, it almost looks like you're running the task once and then a fraction of a second time. How does what you measure on the scope compare with what you are expecting? Is the duration shorter? Longer? My guess is longer because that DAQmx write should start and stop itself, and then it gets started and stopped again after.
04-18-2021 09:21 PM
MrMattPayne made a good point -- it appears you have auto-start set to True during your call to DAQmx Write. I didn't notice because your True boolean wire doesn't enter the icon where its terminal is located. Set that to False instead, and come up with a way to put some time delay between the explicit call to DAQmx Start and the one to DAQmx Stop.
But that's not all. You *also* need to make a call to DAQmx Timing to configure a sample clock and buffer *before* making the call to DAQmx Write.
Have a look at the shipping examples for both finite and continuous voltage acquisition, which will show you a good place to start. (You may not need the stuff related to triggering and TDMS logging, so feel free to remove those parts when you save a copy of the example in one of your own working folders.)
-Kevin P
04-23-2021 04:20 AM
Thank you all for the responses. It helped me a lot and the software works as expected now!