06-05-2006 12:07 PM
06-05-2006 12:34 PM
There are three X-bar chart examples in [labview]\examples\spc\Spc_exmp.llb...those should help you. Also, you can show the Context Help window (Ctrl-H) and hover your mouse over the VIs (like "Draw Control Chart.vi") and read the descriptions of those VIs. You can also get more detailed help on those VIs by clicking the "Click here for more help" blue link in the context help (I believe the blue link says "Detailed Help" in older LabVIEW versions).
Hope this helps,
-D
06-05-2006 01:33 PM
Darren,
That did help thank you. I have one additional thing to add though. I have found the slope of a curve and I am trying to have a running X-Bar chart on that slope value but the XBar chart vi takes a 2-D Array of doubles where I only have one scalar double each time the VI is ran. Any ideas on how I could get that to work?
Dave
06-05-2006 04:30 PM
Hi Dave,
It looks like the X-bar & S Chart.vi assumes that you're giving it an array where each row represents a collection of samples. Each row is averaged, and the value is plotted on the X-bar chart. I'm assuming you're going to have an array of these slope values that you eventually want to plot in an X-bar Chart. In that case, you can simply use the Build Array function to turn your 1D array of samples into a 2D array. I think you may need to use the Transpose 2D Array function to turn your 1D array into a column of values. Then wire this 2D array into the X-bar VIs and you should be set.
Now if you want to generate your X-bar chart in "real-time", i.e. you want the X-bar chart to update as your VI runs and more slope values are calculated, you should check out [labview]\examples\spc\spc_demo.llb\"Real-Time" SPC Demo. This is an example VI that shows an X-bar chart updating as values are calculated.
I hope this helps,
-D
06-06-2006 07:03 AM
Darren,
I haven't checked that demo out yet but I had a thought.
Each time the VI runs, it outputs the slope to a database. Do you think it would be too cumbersome to read these slopes in from the database each time to updated the Xbar chart?
David
06-06-2006 10:03 AM
Hi David,
Do you want to see your X-bar chart update with each new value while your VI is running? Or do you just want to run a VI once that looks at all past slope values and plots them on an X-bar chart? Depending on which of these scenarios you want to do, I believe I've made suggestions for both of them in my previous posts...check out the "Real-Time" example if you plan on seeing your X-bar chart update while the slope values are being acquired...check out the standard X-bar example if you want to plot a bunch of previously-acquired slope values at once.
-D
06-12-2006 07:59 AM
06-12-2006 11:55 AM
Your slope value is being calculated only one time...outside the main While Loop. You are then wiring this single value into the While Loop, and it is never changing. Thus, your graphs will never change because your slope value is never changing. If you want to continually calculate the slope value, you'll need to do it inside your processing loop, not outside. Notice how in the Real-Time example there is a "Read Meas. Data" subVI in the first frame of the sequence structure inside the loop? That VI is generating dummy data values...*different* dummy data values on each loop iteration.
-D
06-12-2006 12:56 PM
I tried the same thing using a for loop with 1 N iterations and that didn't seem to output the correct thing either.
My main VI is an altered version of the Cont Acq & Graph w/SW trigger example and I have put a Write Measurement file inside of a sequence structure inside of the case structure on the end. The second part of the sequence is the VI that I sent you before. Do you think that it would be more beneficial for me to do all of the analysis within the acquisition VI rather than having separate VI's like I do?
Attached is my main Acquisition VI if it is unclear as to what I am doing.
http://www.rit.edu/~dwv2280/Sta1.vi
David
06-12-2006 12:59 PM
David,
If you want to see *different* slope values plotted on the X-bar chart, then yes, you will need to do your acquisition and your X-bar chart plotting in the same loop. Alternatively you could have separate loops and use some data sharing mechanism (globals, locals, queues, etc.), but as you have it right now, wiring a single slope value into your charting loop will result in a chart that never updates...it will just display the same value over and over again.
-D