Showing results for 
Search instead for 
Did you mean: 

how to save the first data within for loop


My project is to make a measurement system.

So the system is divided into two subsystem, they are manual system and automatic system.

I need to measure the voltage and the current. However, the current is given by the first voltage in loop then divided by the resistances given from digital potentiometer. So I think that i need to save just the first output voltage when the voltage is maximum to be used for the current. I want to get the current real time.please help me.

0 Kudos
Message 1 of 8

Measure the first voltage before the loop?


G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
0 Kudos
Message 2 of 8

If I understand you correctly, you are sourcing Voltage, and measuring resistance in order to calculate current.  If voltage is known at all times, why do you need to store it?


Besides that point, you can quite easily store a value from a specific iteration in a control.  Compare the iteration value to zero and wire the boolean result to a case statement.  If iteration equals zero, wire the voltage value to a control.


0 Kudos
Message 3 of 8

I couldn't use 2 visa read in one vi. So I don't know what to do.

0 Kudos
Message 4 of 8

My point is that you are sourcing voltage, you don't need to read it.  You should be setting the voltage in order to use Ohm's Law.

0 Kudos
Message 5 of 8

Em, The resistance is the input, so I always know the resistance, the measurement variable is the voltage. I got the current from divided the first output of voltage when the resistance is max and the resistance that i give. I need every value of the voltage when the resistance is changed, but I also need the first voltage to be stored and used as a constant value to  be devided with whichever input resistance i give so i can get the current.


I don't quite understand what you mean. Please explain more to me. I'm sorry if I didn't understand because I'm a beginner. Thanks for replying my post. 

0 Kudos
Message 6 of 8

I asssume you'll have a loop measuring the voltage? Add a initial measure of the voltage before the loop and it'll be the initial value wired in, or check the 'i' of the loop and if 0, feed the voltage read to a shift register, else wire through the old value.



G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
0 Kudos
Message 7 of 8

So this comes from some confusion with your original post.  It states that resistance is given from a digital potentiometer and I took this as you were measuring resistance.


Regardless of this fact, you should only be using 1 VISA read.  Ohms law : V=IR.   In order to use this, you need two known values.  1 is a value that you set for the experiment.  Source Current, Set Voltage potential, etc.  Since Labview sets the operating condition, it already has access to this value (if you are manually setting this you shouldn't be).  You measure one of the remaining ones (your single VISA read) and you calculate the third.


I am still lost by your thought process.  If you are measuring voltage to calculate current, why are you using the first voltage also to calculate current???



But, going back to your purpose of storing the first voltage value, I gave you an answer in my first post and so did Yamaeda.  Either option will work.

0 Kudos
Message 8 of 8