02-25-2011 02:14 AM
Hi all,
There are two bugs I've been struggling with (I'm fairly new to LabVIEW):
1) I would like to click an OK Button, execute a while loop, and pass data from the while loop during each iteration until stopped. I am doing this to output an analog signal with the DAQ Assistant Block. I have the source of the signal as a Simulate Arbitrary Signal block with the "Entire signal each iteration" radio button checked. The while loop is supposed to allow me to output the signal N times successively. I can successfully output the signal a single time with a button press, but have had no luck with the N times effort. The Wait Until Next Millisecond Multiple block is currently only used for debugging so I can see the LED indicators flash.
2) The Dynamic Data output from the Simulate Arbitrary Signal block is passed into a "WDT Scale Delta T" block to change the time step between samples in the signal and thus change the frequency of the signal. This function currently works, but only after I stop the vi. That is, I can set a new frequency to output the signal, but have to click the "Stop" button and then the "Run" button in order for my changes to take effect. You may need an oscilloscope to debug this problem for me since the problem does not present itself in the vi. I have a Waveform Graph on my front panel that is monitoring the data input into my DAQ Assistant Block. The Waveform Graph indicates that the time step of the signal has been changed, however, when the signal is physically output on my PCI card, the time step remains the same until the vi is restarted.
I have a PCI-6052E and LabVIEW 10.0
Thank you in advance for your help
02-28-2011 03:07 PM
Hi MStresh,
First off, instead of using Wait until Next ms Multiple.vi use highlight execution. This will slow down your vi and allow you to track data flow.
Next, the section of code bellow will result in true value regardless of your inputs.
The logic inside the nested while loop will result in the tunnel out always being a true value. Then the logic outside the loop will keep it as a true value. Also, this logic will not control how many times the DAQ Assistant runs.
Take a look at this example: Update Multiple Channels of Analog Output On-The-Fly
You can use it as a starting point and update it to output the signal you want.
Since you are just getting started with LabVIEW and DAQ you may be interested in taking some training courses. I would suggest Core 1 and Data Acquisition and Signal Conditioning.
<Brian A | Applications Engineering | National Instruments>
03-01-2011 05:13 PM
Hi Brian_A,
Thanks for the links, I will definitely check them out.
A few questions:
"The logic inside the nested while loop will result in the tunnel out always being a true value. Then the logic outside the loop will keep it as a true value. Also, this logic will not control how many times the DAQ Assistant runs. "
From running my vi, this does not seem to be the case. I can click the "Step" OK Button and witness a single waveform output on the DAQ. Clicking the "Run N Times" OK Button seems to cause the program to run through the while loop and then cause a single waveform to be output after the while loop has run (the output tunnel is False during the whole extent of the loop). I am definitely still a LabVIEW noob, but from what I can see, the Arbitrary Signal Waveform is currently set to output one full period each time the DAQ is enabled. This behavior is selected for by the OK Button being read as True once by LabVIEW.
Also, I am still confused why the WDT Delta T block scales my signal appropriately as displayed in the Waveform Graph, but incorrectly adjusts the delta T on my actual DAQ output. Do I need to somehow reset the DAQ, or other manual operation to mimic a vi restart?
Again, thank you for all your help
- M
03-04-2011 06:17 PM
You are not tunneling out of the while loop until the loop is stopped. So even though during the while loop execution the value is false, the way you have set the logic will result in the last iteration outputting a true value. So the tunnel out is always true.
I'm not quite sure why the output is not updating but you can accomplish changing the frequency by implementing this example in a while loop but instead of reading the data from a file, simply use your stick-slip data. I've tested this out and it does work.
<Brian A | Applications Engineering | National Instruments>