02-12-2009 03:09 PM
02-13-2009 11:28 AM
Hi Fred,
You can certainly output two different waveforms on two different channels, however, there are a couple caveats to this. You can only have one task for this output because your analog output board only has one AO sample clock. This means that if the "slightly different waveforms" that you are trying to use are different because of their timing qualities then you cannot generate them both at the same time using "Use Waveform" for your timing. If the timing parameters for each of the waveforms is different there will be a conflict in what timing is actually used, which means the VI will use whichever configuration VI it gets to first, which should throw an error. The way around this is to use sample clock timing with the AO Sample Clock. Now with the rate you set for this and the number of samples that you use to represent your waveform you can generate whatever you want for both signals. I would suggest modifying the waveform to output to be one period of the square wave you want and changing the number of samples you use to represent that one period. For example if you want one of your square waves to be running at 1000Hz and the other to run at 100Hz, both with 50% duty cycle, then you can set your sample clock frequency to be 10kHz. Then you would set the single period of your first square wave to use 10 samples (5 high and 5 low) and set the single period of your second square wave to use 100 samples (50 high and 50 low). To combine the two signals you can just append the waveforms together and set your DAQmx Write VI to use N samples, N channels and then specify the two channels in the one AO channel input at the DAQmx Create Channel VI. Hopefully this helps out.
Chris W
02-13-2009 12:39 PM
Is there any way that you could send me some example code. I have been trying to get how you did this but to no avail. Thanks
02-13-2009 02:51 PM
If you have some revision to your code that you would like me to take a look at, I would be willing to do this. Would you mind posting a VI?
Chris W
02-16-2009 06:53 PM
Hi Fred,
I decided to create an example. I posted this example on the Developer Zone Community site. Here is a link to the code that I posted. The code that is posted was written in LabVIEW 8.6.
Chris W
02-17-2009 06:05 AM
Thanks, I forgot to post that I had gotten it.
Fred
02-17-2009 10:25 AM
Hi Fred,
I would encourage you to post your code on the community site that I had linked to as well, if you feel it could be useful for the community. Glad to hear that you got it working, though.
Chris