LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best structure to measure voltage across 8 resistors in parallel via 8 separate analog channels

Im setting up a simple circuit w/ 8 resistors in parallel. It will be connected to a PCI 6036E DAQ. I need to measure the voltage across each resistor, take x amount of samples, and then automatically move on to the next resistor and so on and also save the values to a file.  Im going to connect each resistor to a separate analog channel.  I have already setup a vi to read the voltage across one resistor and take X amount of samples, display the waveform, and also save the data to a file.  
 
What would the best structure be to run this test?  I am thinking a Sequence structure, but it seems like people tend to avoid using that. Or would a case/while loop be better?
 
From my understanding, the data will not pass out of a sequence structure until it is finished. this doesnt seem to be that big of a problem for me, as I only want the data at the end....
 
thanks for the help!
0 Kudos
Message 1 of 26
(3,498 Views)
Use a for loop.  Put your code inside the loop, but delete the analog channel number.  Make an array constant and poplulate the array with each analog channel number.  If you wire the array to the loop (left side), you will see the terminal is a hollow box.  This means indexing.  The loop will operate on the first array element, then repeat with the second array element, and so on until all array elements have been processed.  Wire the hollow box to the point in your code where the analog channel number was deleted.  Now the loop will execute the same code using a different channel each time.  If you wire the output to the right edge of the for loop, you will again see the hollow box.  All of your measurements will be contained in an array at that hollow box.  Process the outputs as you like, maybe display the entire array, or index the array to get the individual elements, whatever.  The advantage of the for loop is that you have to write your code only once.  Everything is seen on one screen making it easier to read.  Sequence structures are not good programming practice because a lot of the code is hidden, and you have to go to different sequence frames to see the hidden code.  Also, why duplicate the code in each frame when the loop will do it all.  Good luck.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 26
(3,479 Views)
hi thanks for the tip.... thats what i was thinking of doing as well.... i was pretty sure sequence was the worst way to go about it.
0 Kudos
Message 3 of 26
(3,474 Views)
Just curious, but why do you need to measure the voltages separately? The board has enough channels to measure all at once.
0 Kudos
Message 4 of 26
(3,462 Views)
One basic tenet of electronics is that the voltage across resistors in parallel is the same!
Thus there is no need to measure them separately and with separate channels, unless I misunderstood your post.
Just 1 channel will suffice
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 26
(3,455 Views)
Analogkid2digitalman....

Only if all the resistors are the same......

What if one is a photoresistor, another some other type......
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 6 of 26
(3,452 Views)
Shoneill:
 
The voltage has to be the same, regardless of the individual resistances. They are connected in parallel; all their 'top' leads are connected together, all their 'bottom' leads are connected together. The voltage potential across their 'top' and 'bottom' leads has to be the same. It is the currents through them that will differ. Resistors in SERIES however will have different volatages across them, but their currents will be the same.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 26
(3,451 Views)
AK2DM is right.  However, I suspect that the real setup is 8 different circuits not connected to each other, but all testing is done in parallel.  Perhaps some clarification is needed.
- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 26
(3,444 Views)
yeah you guys are all somewhat right,
 
how can you measure them all at the same time? I thought the DAQ was limited to measuring one analog channel at a time? yeah voltage will be the same across all the resistors, i must have been tired or something, instead ill measure the currents, because i know the resistor values.
0 Kudos
Message 9 of 26
(3,437 Views)
To determine the currents you still only need 1 channel. Measure the voltage across the parallel network, then calculate individual currents by dividing the measured voltage by each known resistor value.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 10 of 26
(3,382 Views)