LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cann DSC x-bar R chart vi be configured for real time charting

I have an extensive vi written to perform automated testing on my product (pump).  I am collecting pneumatic & electrical performance at multiple load points and intend on charting x-bar & R charts for each individual pneumatic test point and electrical test point.

 

The VI for x-bar & R charting has an input that requires a 2-dimensional array.  The data that I intend to supply to the chart is my 1-dimensional array containing the results from my sub-group. (I will be collecting data for 5 units out of every 20 initially)

 

The help is not real clear on what is required in the 2-dim array and so I either need to understand better what it is expecting or how to change it to accept a 1-dim array of data.

 

Any assistance wiht this is much appreciated.

 

Thanks

 

Doug

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 1 of 5
(2,960 Views)

Hi Doug -

 

Looking at the detailed help for the x-bar & R Chart VI, the input cannot be changed into a 1D array: http://zone.ni.com/reference/en-XX/help/371618G-01/lvspc/x_bar_r_chart/#details

More specifically, if we look at the details for the sample input: "samples X specifies the samples on which to compute control limits and plots. Each row is a sample with n observations where n is the number of columns in the 2D array. N is also known as the subgroup size. The maximum sample/subgroup size permitted is 25, the minimum is 2."

 

The x-bar & R Chart is a type of control chart that is used to monitor one variable's data collected at regular intervals.  So in your application you would have two x-bar & R Chart VIs: one to monitor the pneumatic performance and another to monitor the electrical performance.

 

For example, if we were to monitor 2 different ports for pneumatic performance then we would have two rows of data corresponding to .  Each row would have at least two "observations" of the pneumatic performance, which results in a 2D array.  The reason why we have multiple observations is because without two or more observations it would be impossible to obtain a range or average which is what the x-bar & R Chart supplies.

 

I hope this explains what the VI is expecting.  Let me know if you need more clarification.

0 Kudos
Message 2 of 5
(2,938 Views)

Thanks for the reply

 

After a weekend of thought, I looked this morning and figured out what the reasoning of the 2D array is.  As the function re-creates the control chart with each execution, it needs all the subgroups that are to be charted.  I had originally approached it that the vi would append the chart.  Not so.

 

Each row of the array then will be a seperate subgroup (2 to 25 readings/samples/columns) so I can actually transform my intial 1D array into a 2D array format with only one row to start with. That is what I was struggling with to start with and now I got it to work ok.

 

Problem now is on accumulating the multiple subgroups throughout the course of the day and from day to day.

 

My inital approach is to append to a (preferably a binary) file as I accumulate each subgroup of data.  I can then read the last, say 25, entries of the file to feed into the ctrl chart vi.

 

I am currently struggling with how to write and read back the 1D array data.  I could do excel but don't want that much overhead in the program as I have four parameters that I will be charting.

 

I have been trying the basic binary write / read format and from the file size function, can see the file getting larger but have not been able to read the data back out sucessfully.

 

I know I could run a loop with shift registers but I am displaying the control charts on a seperate monitor so need to run them in a subvi that has the front end open on that monitor.  I also want to be able to go back and pull the subgroup data later for additional analysis as needed.

 

I know this changes the nature of the original topic but wanted to continue in the same thread since it is related to the overall goal.

 

Thanks for any continued assistance

 

I can post my code if needed

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 3 of 5
(2,931 Views)

Hi Doug -

 

Binary files can be convoluted as they are written very specifically and if not extracted correctly (in the exact order that it was written) the data can be erroneous in the fact that it is not in order.  Have you tried looking at some of the binary file examples that come with LabVIEW?  What type of issues are you experiencing with the binary files specifically when trying to read the data back?

 

In the meantime, what I can suggest is to write with LabVIEW TDMS files - they have small overhead, like binary files, but are more easily handled in LabVIEW so that you can add subgroups throughout the course of the day.  In addition, if you ever wanted to look at the data in Excel, there is a TDMS add-on that you can use.

 

Some great starter articles for TDMS include:

1. Development Zone article: Introduction to LabVIEW TDM Streaming VIs

2. TDM Excel Add-In for Microsoft Excel

 

Let me know if this helps.

 

0 Kudos
Message 4 of 5
(2,920 Views)

OK  Got the binary write and read figured out (mostly)  The issues I ran into were more what I would call syntax related, like having to use the open vi and set file position vi to complete the appending write vi but then not using the refnum from the write to feed the file info to read vi instead having to feed the original file path again.

 

I found another thread that gave a good example on decompiling (my word) the array info from the cluster format that the read vi generated back into an array format and in fact, it ended up taking my 1D array and after all the functions, turning it into a 2D array that was ready to feed into the control chart vi.

 

I have posted a snapshot of the code so that if there is any really bad form that I am using, I am open to making it more efficient.  I kow that my method for pulling the desired variable out of the original subgroup results clusters is a little cumbersome but it does work.  I may make part of that routine into a subvi just to better organize this vi.

 

 Hopefully the attachment is clear enough to be readable.  Could not figure out how to paste it directly into the post.

 

My only open item now is on the file read, setting it up to read only the most recent 25 (or some number) of data sets.  Since my data set size should never change once I am running, I am expecting that on my first write to a new file, I can read the file size and determine what the value will be for each data set and then with some math, complete an offset and set position before performing the read.

 

If this doesn't sound correct, I am open to other options for sure.

 

I do have another issue that has cropped up that I am struggling with that I will mention briefly but will start a new thread as it is not relted to this issue but am mentioning it in case anyone reading this thread has any insights.  That is essentially sending command strings to a serial connected power supply using TQLP library functions. Details will be in a new thread.

 

 

Thanks for the continued assistance

 

Doug

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 5 of 5
(2,911 Views)