04-08-2010 11:39 AM
Hi all,
I'm doing a college project and I've been working on a vi to measure the phase difference across an RC circuit. I excite a sine wave of approx. 2kHz from LabVIEW. I then measure the output with two analog inputs across the resistor. There has been an inconsistency in the results measured.
I know the actual phase difference to be 1.5 radians, however when I run the program I get a value ranging from 1.5 - 1.75 radians (this value varies each time the program is run but remains constant for each running). It could be down to mulitplexing delay but the error is not consistent so I don't know how to account for it.
It was suggested on the forums to try a lower level vi's and that's where I'm having big difficulties. I can't seem to get them working and have no experience with them.
Below is two vi's. The first my express and working vi. Second my "attempt" at converting it to traditional vi's.
Could someone please have a look at them and help me identify any problems I'm almost out of time for my project so I don't have much time for my usual trial an error approach)
I haven't been able to get to the lab over the Easter break so one question I would ask is can I select two analog input channels from this set up?
The last time I tried this set up I was receiving no data on any of the vi's within the loop. Not even on the measurement graph.
Kind Regards.
Solved! Go to Solution.
04-09-2010 06:24 AM
Hey Jackthelad!!
I may have missed something here, but I think that the following piece of code is always going to generate a 0 (zero). You are taking the same data from a single channel, analysing the data, then subtracting the phase from each other. But, because you are analysing the same data twice, it will always result in a 0. Is this what you are finding?
If you need to read from 2 seperate channels, you will need to modify the code to modify the code to look like the following.
I have also attached the .vi.
Hope this has been helpful.
Best of luck with the project,
04-09-2010 06:38 AM
04-09-2010 07:11 AM
Also, here is a great DAQmx api tutorial...
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
http://zone.ni.com/devzone/cda/tut/p/id/2835