04-09-2010 12:46 PM
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.
04-09-2010 12:55 PM
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
04-09-2010 01:07 PM
04-09-2010 01:22 PM
04-09-2010 01:35 PM
04-09-2010 02:40 PM
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.
04-09-2010 03:58 PM
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.
04-09-2010 04:53 PM
01-05-2013 04:45 PM
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.
01-05-2013 05:17 PM - edited 01-05-2013 05:18 PM
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.