10-13-2009 02:48 PM
What I am doing with labview, is using an output module to control a ball valve, and ultimately the flow rate throug a pipe. I'm trying to set up a loop that will incrementally open the valve, and at each stop point record the valve position and flow rate (flow rate from a meter with 4-20 output). Then using the array of data, I should be able to plot a line inbetween each pair of points and use my line segments to define the flow curve.
Then in operation I should be able to ask for a flow rate, and using the initialization data, labview can send the right position signal to the valve.
I'm stuck on building this array however. Also, at this point I am simulating the signals, positions and flow rates based on some arbitrary relationships.
For now I would like to record the points to the array based on the click of a button. In te future I will automate.
Solved! Go to Solution.
10-13-2009 02:54 PM
10-13-2009 02:55 PM
to biuld an array you can use the build array.vi or a for loop...
can you maybe post an example of what you are having a problem with?
10-13-2009 03:01 PM
I am using that, with a feedback loop, so that all the points end up in the same array. The problem is the random zeros that come in whenever I am not adding to the array, creating a spikey looking graph, where each added point connects to zero, and then back out to the next point.
Also, if it continuously updates, rather than on a button click say, the array will plot a curve that is incorrect.
I am working on uploading. Unfortunatly my company internet is rather restrictive on uploads, so it might be a little while.
10-13-2009 03:08 PM - edited 10-13-2009 03:10 PM
Hi krwlz101,
"The problem is the random zeros that come in whenever I am not adding to the array"
Did you encapsulate the "build array" node in a case structure? So only adding "real" measurement values?
Oh wait... There are zeroes added when you don't add to the array??? I really like to see that vi
10-13-2009 03:16 PM
OK,
So I'm feeling like a moron here, but being new to labview, I will ask...
So I put the build array into a case structure. How do I access the array during a false case (where I am not adding values)?
10-13-2009 03:20 PM
10-13-2009 03:23 PM
But I don't need the data stream during the false case. I need the array of whatever values I've recorded. Your VI gives me the result of the build array during true, and the values I don't care about during false.
Right?
10-13-2009 03:29 PM
10-13-2009 03:29 PM - edited 10-13-2009 03:31 PM
Hi krwlz,
it seems you really need to add an attachment here - a picture is worth a 1000 words...
Edited: don't have LV2009 installed at home...
You said "How do I access the array when not adding values?" and now you say "the values I don't care about during false"...
So what is it that you want? Access the array or not? Add only real values when needed or not?
The "array" is kept in the shift register. Values ("0") are only added in true case (when you get new measurement data). In false case you can access older data...