07-22-2009 06:22 AM - edited 07-22-2009 06:23 AM
Hi, i´ve got a problem, any help is welcome.
I´m trying to create a continious (SinusVoltage) synchronized AI and AO with Labview 8.5.1. The Frequency should be adjustable and the phases of both signals should be compared during runtime.
I tried it like shown in the posted vi, but its not really working. sorry if its a little bit confusing.
Program : LabView 8.5.1
Chassis : NI cDAQ 9172
AI : NI 9215
AO : NI9263
thanks, Andi
07-23-2009 08:26 AM
Hey Andi,
To synchronize AI and AO you will need to share the timebase. You also mentioned that you want to have a adjustable frequency.
I assume you don't want to change the sample clocks timebase and that you just want to adjust the frequency of the generated sinewave.
In that case you simply need to synchronize AI with AO in sharing the timebase (see example Multi-Function-Synch AI-AO.vi) and set the output frequency via the corresponding property node (see example Cont Gen Voltage Wfm-Int Clk-Variable Rate.vi). You will find theese examples using the LabVIEW Example Finder.
If this is not the case and you want to change the sample clock, you will need to use a Counter Task generating the Sample Clock. Because you are using cDAQ you will need an extra DIO Module to make an external connection to share the timebase to the AI and AO module.
Hope this helps,
Christian
07-27-2009 12:45 AM
07-27-2009 01:03 AM
Ah, ok i already tried that, but couldnt get it to work. I put both, writing and reading in one while loop and synchronized both before the loop like in the examples you mentioned. i also used an external onboard clock to synchronize them, but i always got changing phase differences.
Could be, the problem is, im comparing the signal before writing. How could i extract the waveform after the writing vi?
Another thing is, someone mentioned 2 while loops connected with each other, but he didnt told me, what he meant exactly. Do you have an idea, what he meant?
Could you please explain to me, if its important to change the sample clock with the frequency? Im new to LabView and couldnt find any good explanation for that.
mfg, Andi07-31-2009 01:39 AM