cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Store changing numeric values to an array

Hi,

I am doing an experiment in which I need to record a numerical value. The numerical value can change and I wish to store the numerical value to an array every time it changes.

 

I have attached a VI I made which i hope explains what I mean. 

 

Thanks for your time. 

0 kudos
Mensaje 1 de 14
13.266 Vistas

Use shift register and build array.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 kudos
Mensaje 2 de 14
13.263 Vistas
This is what RavensFan mean.
Rodrigo Cuenca
www.cidesi.com

Mensaje 3 de 14
13.251 Vistas
As far as Rodrigo's solution: Using equality/inequality operators on floating point values is a BAD idea. Especially on numbers that are the result of some computation. I'm sure we're going to see another post about "why can't LabVIEW correctly compare floating point numbers?". At which point I will have another nickel in my retirement fund.

0 kudos
Mensaje 4 de 14
13.241 Vistas
Thanks a lot, have a lot of study to do on shift registers!
0 kudos
Mensaje 5 de 14
13.239 Vistas

smercurio_fc wrote:
As far as Rodrigo's solution: Using equality/inequality operators on floating point values is a BAD idea. Especially on numbers that are the result of some computation. I'm sure we're going to see another post about "why can't LabVIEW correctly compare floating point numbers?". At which point I will have another nickel in my retirement fund.


 

I use (a modified version of) a VI that I borrowed from Moore Good Ideas called Approximately Equal.vi. This type of VI can be used to compare two DBL's to within, say, 0.1% of each other. I think it's handy. I have attached Approximately Equal.vi.

 

 

Richard






Mensaje 6 de 14
13.216 Vistas

Broken Arrow wrote:

smercurio_fc wrote:
As far as Rodrigo's solution: Using equality/inequality operators on floating point values is a BAD idea. Especially on numbers that are the result of some computation. I'm sure we're going to see another post about "why can't LabVIEW correctly compare floating point numbers?". At which point I will have another nickel in my retirement fund.


 

I use (a modified version of) a VI that I borrowed from Moore Good Ideas called Approximately Equal.vi. This type of VI can be used to compare two DBL's to within, say, 0.1% of each other. I think it's handy. I have attached Approximately Equal.vi.

 

 


That's a nice VI. Here is amodified version which allows you to specify the tolerance.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Mensaje 7 de 14
13.202 Vistas

Hi,

I created a VI that saves the measure values from a load cell into an array from. I have set certain parameters and by changing them also changes my output array. I want to store these new values in array into a new row while the previous values are still stored in upper rows. 

I have the attached VI. 
I want that if I change the parameters, the new values are stored in new row without changing the previous values.
Help needed urgently. 


0 kudos
Mensaje 9 de 14
12.575 Vistas

You should have started a new message thread.  This one is over 2-1/2 years old.

 

It's not clear what you are trying to do or why you wrote your VI the way you did.  You have a 7 iteration for-loop within a while loop.  You start with an array of zeroes size 15 by 7 every iteration, then proceed to use insert array to put values you into which makes your array grow while still having a bunch of zeroes in there.  (Insert into Array is almost always the wrong function to use.  Build Array is the better function 99% of the time.)

 

Your 7 iteration For Loop is going to put in the same data 7 times.  Actually it is kind of undetermined.   Becuase of the abuse of local variables, you have a race condition.  So you are entering either 7 stale values from another iteration, 7 values from the current iteration, or some combination of stale and new values depending on what code wins the race.

 

If you want to do something enter new data in the array as each loop of the outer while loop executes, then you should have your array being build with a shift register on the outer while loop rather than starting with a new array every iteration.

0 kudos
Mensaje 10 de 14
12.569 Vistas