04-12-2010 02:28 PM
As an update, I was able to achieve both the analog out and the digital out. I used the Ctr0 output as my physical signal. What I still have to do is:
1) be able to change the waveform scaling on the fly
2) plot both the analog waveform and location of the counter pulse on the waveform chart/graph(and have it update continuously)
3)shift the counter pulse relative to the analog waveform on the fly(number 2 above is useful for visualizing what is going on)
4)Clean up the VI.
I've also attached a sample waveform is anyone has a chance to test this out.
Thanks,
Gabe
04-12-2010 04:40 PM
Hi Gabe,
1. You can place the waveform scale function inside of the while loop to add on the fly control for the waveform scale.
2. If you have your waveform chart inside of the while loop, it will also allow for continuous updates as it receives new data into its buffer.
3. You can change the initial delay on the fly by placing a DAQmx Channel Property Node for your initial delay inside the while loop with a control for this value.
4. A first step for cleaning up the VI would be to try out the Block Diagram clean-up utility. You can select certain sections and choose to clean them up piece by piece. Do this by selecting the desired items and going to Edit»Clean up Selection or by pressing Ctrl+U.
Best,
04-12-2010 06:42 PM
Hi Adam,
Thanks for the suggestions. I had done some of what you had recommended already, but it doesn't seem to helo
>1. You can place the waveform scale function inside of the while loop to add on the fly control for the waveform scale.
> 2. If you have your waveform chart inside of the while loop, it will also allow for continuous updates as it receives new data into its buffer.
I had both of these already in place. The waveform chart updates(I hadn't noticed autoscaling was on), but the physical output does not change(checked on oscilloscope). In my current example, my waveform has 33 points, with a period of about .8 seconds. I'm not sure that I'm setting the number of samples per channel correctly(33). I think that the buffer may be storing several instances of the waveform, and not updating the physical output too often.
3. You can change the initial delay on the fly by placing a DAQmx Channel Property Node for your initial delay inside the while loop with a control for this value.
I am not sure I inderstand this part. Is this the property node for the AO and that while loop? I searched around for a initial delay for analog out but couldn't find one. Or do I set the initial timing delay for the counter in the analog out loop?
Thanks,
Gabe
04-13-2010 10:57 AM
Hi Gabe,
Here is what I was suggesting for the scaling:
Here is what I was referring to for the initial delay property node for your counter pulse output:
There is also a DAQmx Timing Property Node that you could put into your while loop that will allow you to change the number of samples per channel, which determines your buffer size in continuous acquisition, as noted in the context help:
Best,
04-13-2010 03:17 PM
Hi Adam,
Thanks once again for getting back to me. I realized that I had sent you an older form of the VI that I had been working on. In the newer ones the Scale function is inside of the While Loop. The waveform chart changes immediately, but the physical output(according to the oscilloscope) still does not change at all! Does the Write 1chanNsamp act independently from the loop?
My question regarding the samples per channel was not how to change them, but rather if that might be affecting how often the "Write 1chan Nsamp" is sending the new waveform to the buffer. I was setting the #samples per Channel and the inital delay via Controls on the front panel, not Property Nodes. Should this make a difference?
I've also read some more on Counters on the forum and the website, and it seems that it is actually not possible to change the counter parameters on the fly. Rather it has to be stopped and reset. In light of this, I'm wondering if you think it would make more sense to use the counter as the timing for the analog waveform, have it write N samples per loop, but also include a trigger delay for the analog out? I can live without the time-shifting on the fly, but it would be useful.
Once again thanks for your continued help on this topic, I'm new to waveforms, buffers and counters(last card was the USB-6009) so what I had thought would be straightforward for me is turning out not to be.
Gabe
P.S. I've attached the updated VI that I've been working on.
04-13-2010 05:07 PM
Hi Gabe,
If you look more at what is happening in your data flow, it can be seen that you will run through everything left of your while loop; these VIs are used to configure your DAQmx tasks, and they must be configured before you run the VI. After you run the VI, the control you have set for the samples per channel will not affect what is being output, because the VI will never actually register what is changed in the control until you top the VI and run it again. This is not a property that can be set while the VI is running, and I apologize for leading you astray before.
Best,