Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ application help

Hi there,

Just wondering if someone can help or advise me on how to approach some DAQ programming.

I want to use an M series card to output an analog output sine wave to a UUT. I need to measure the phase difference between the signal before and after the UUT, i.e feed sine wave through UUT and see what phase shift is caused by the UUT.

I'm using an M series and wonder how I can structure this code. I realise that this should ideally be done with an S series card but i'm stuck with m series for various reasons. Will the multiplexing get in the way and can it been compensated?

My initial idea is to generate the sine wave in software, and use an AO in regen mode in order to feed the sine wave to the UUT. I then plan to connect an AI to the output of the UUT. Now, should I also feed the output that i'm supplying back into an input so that I can compare the two? How would I need to sychronise/trigger these?

Any example code would be greatly appreciated or any other ideas!

thanks a million
0 Kudos
Message 1 of 7
(2,827 Views)
bump
0 Kudos
Message 2 of 7
(2,806 Views)
JS2000,
Are you using LabVIEW?? Another language??
Ideally, yes, you would want to use an S Series Board, or another form of simultaneous sampling when you are trying to determine phase relationships. However, with your M Series board, you can control the rate at which the ADC switches from channel to channel. So you can make the delay as small as possible. In DAQmx, this is referred to as the convert clock rate, which can usually be as fast as the maximum sample rate of the device. You can find out what the maximum convert clock rate is as well as set the convert clock rate with a DAQmx Timing Property Node (in LabVIEW). In the property node, select More>>Convert Clock, then Rate or Max Rate. In text based languages, the functions are DAQmxGetAIConvMaxRate and DAQmxSetAIConvRate.

As far as your program, you can have the AO and AI occurring in the same LabVIEW program. I would suggest taking a look at the Example Finder in LabVIEW, by going to Help>>Find Examples. Then, for the AO, navigate to Hardware Input and Output>>DAQmx>>Analog Generation>>Voltage, then maybe "Cont Gen Voltage Wfm-Int Clk.vi". For the AI: Hardware Input and Output>>DAQmx>>Analog Measurements>>Voltage, then maybe "Cont Acq&Graph Voltage-Int Clk.vi". Lots and lots of great examples in there. You can even copy and paste an AO example to an AI one or vise versa, to have both parts in the same VI.

And yes, I would wire your AO to your AI before and after your UUT. Then you could compare the two AI channels. Also, I would make sure to use differential for your terminal configuration if you can spare the channels (which of course you can if you only have two analog inputs).

Hope some of this info helps!

-Alan A.
0 Kudos
Message 3 of 7
(2,797 Views)
I am sorry, forgot to mention, using LV 7.1.

OK I get what you are saying, but still unsure about the interchannel delay. If I am sampling before and after UUT using m series, I'll obviously get an offset in any phase measurements due to interchannel delay behaviour of multiplexed card.

How do I compensate for this? Is the interchannel delay between two channels constant? If not, how would you compensate for this?

Many thanks!!
0 Kudos
Message 4 of 7
(2,781 Views)
Yes, the interchannel delay will be constant, and you can set it as mentioned above. And again, the only way to get truely simultaneous sampling would be a device with more than one ADC, like S Series. Additionally, even if you do have simultaneous sampling, I'm assuming that there will some delay associated with your UUT.
-Alan A.
0 Kudos
Message 5 of 7
(2,759 Views)
I just encountered the same problem today on the test stand I'm designing. The only difference is I have to generate a continuous increasing sine wave. That took me a few tries! But it works great. I'm planning on trying to just shift my input signal by the specified interchannel delay. Right now it looks like it is .6 ms, which seems kind of high to me, but if it's constant it doesn't matter. Let me know what you tried if you don't mind. I'm out of town until Friday so (with no computer!, well one with email anyways). Thanks in advance.

0 Kudos
Message 6 of 7
(2,699 Views)
task,
For analog input, you can obtain the exact interchannel delay with the property node listed in my first post.  Also, depending on what version of NI-DAQ you have, the interchannel delay might be set differently.  See this KB for info on that topic.
-Alan A.
 
0 Kudos
Message 7 of 7
(2,676 Views)