Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Traditional vi help

Solved!
Go to solution

 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.

 

0 Kudos
Message 1 of 4
(3,352 Views)
Solution
Accepted by topic author JacktheLad

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?

 

 1Channel.jpg

 

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.

 

specify 2 channels.jpg

 

Hope this has been helpful.

Best of luck with the project,

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Message 2 of 4
(3,335 Views)
That helps alot. Will get to test it on Monday, thanks for getting back to me.
0 Kudos
Message 3 of 4
(3,331 Views)

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

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Message 4 of 4
(3,329 Views)