LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a VI to measure the difference between two analog inputs (voltage)

I'd like to measure the difference voltage between two analog inputs.

 

Could someone write me a VI for it, please?Smiley Wink

 

I'm new with Labview....Smiley Sad

 

Thanks a lot!!!

0 Kudos
Message 1 of 7
(3,530 Views)

On the numeric palette, there is a function called subtract. As the help for it says, it 'Computes the difference of the inputs.'.

 

Since this is such a simple process, you need to provide some details on why you can't do this. You can wire just about any data type into the inputs. Post your code if you need further help.
Message Edited by Dennis Knutson on 04-05-2009 08:23 AM
Message 2 of 7
(3,523 Views)

If you haven't already done so, the best place to start is by going through the tutorials(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

 

Remember, it's better to teach a person to fish than ... 

Message 3 of 7
(3,499 Views)

 Thanks for your suggestions.Smiley Happy

 

I wrote the codes as shown in the attachment. 

 

but error occurs as:

Possible reason(s):

The specified resource is reserved. The operation could not be completed as specified.

0 Kudos
Message 4 of 7
(3,458 Views)

Did you do a search for that error? It's a very common mistake. You cannot have two separate tasks with the same hardware resource. Just have both channels in a single task and change the DAQmx Read to NChan 1Samp. You then have a choice of getting a 1D DBL Array or 1D Waveform array. Either way, to get a specific channel, you just use the Index Array function.

Message 5 of 7
(3,451 Views)

Thank you for your reply.

 

but i still don't know how to deal with the 'NChan 1Samp'output. how can i extract the two voltages from it and make the calculation?

 

cheers

0 Kudos
Message 6 of 7
(3,428 Views)

As I said, use the Index Array function.

 

 

This is very basic stuff. Please take the time to go through the basic tutorials.

Message Edited by Dennis Knutson on 04-06-2009 10:45 AM
Message 7 of 7
(3,409 Views)