Author |
Topic  |
|
Mike
8 Posts |
Posted - 21 Jan 2008 : 15:42:43
|
I would like to indicate the specification limits on my control charts, either an arrow in the vertical scale or a line on the chart itself. Is there an example of this? Or what would be the best way to implement? |
|
quinncurtis
1164 Posts |
Posted - 22 Jan 2008 : 10:11:13
|
Describe your SPC chart in more detail. What type of chart is it? How many controls lines (i.e. sigma 1, 2 and 3 ?) are you displaying ? Is our software calculating the values of the control lines, or are you ?
|
 |
|
Mike
8 Posts |
Posted - 22 Jan 2008 : 11:20:20
|
SPCBatchVariableControlChart, SPCControlChartData.INDIVIDUAL_RANGE_CHART
Only one control limit, that your code calculates. I tried to specify another control limit with a custom value (the spec limit that I wanted) but that resulted in only adding a 1 sigma or 2 sigma control limit using 1/3 or 2/3 of the calculated control limit. |
 |
|
quinncurtis
1164 Posts |
Posted - 22 Jan 2008 : 12:11:10
|
You were on the right track, creating an additional control limit and assigning it a value. Unfortunately the AutoCalculateControlLimits call will override the assigned value. You could have just reassigned the custom control limit back to your specification limit value after the call to AutoCalculateControlLimits.
Or, better yet, use code similar to the following:
SPCControlLimitRecord ucl2 = new SPCControlLimitRecord(this.ChartData, SPCControlLimitRecord.SPC_GREATERTHAN_LIMIT, 0,"H SPEC", "H SPEC");
this.PrimaryChart.AddAdditionalControlLimit(ucl2, SPCChartObjects.SPC_MEASURED_VARIABLE, 1);
ucl2.ControlLimitValue = 38;
SPCControlLimitRecord lcl2 = new SPCControlLimitRecord(this.ChartData, SPCControlLimitRecord.SPC_LOWERTHAN_LIMIT, 0,"L SPEC", "L SPEC");
this.PrimaryChart.AddAdditionalControlLimit(lcl2, SPCChartObjects.SPC_MEASURED_VARIABLE, 1);
lcl2.ControlLimitValue = 15;
In this example, because the control limits are added to the chart using SPC_MEASURED_VARIABLE attribute, they are not considered part of the SPC sigma 1, 2 or 3 limits and their values are not affected by the AutoCalculateControlLimits call.
Let us know how this works for you. |
 |
|
Mike
8 Posts |
Posted - 22 Jan 2008 : 14:00:41
|
Yes, that is exactly what I was looking for. Thank you.
To modify the LinePlot properties it appears as though I would use SPC_UPPER(LOWER)_CONTROL_LIMIT_2:
GetControlLimitData(SPCChartObjects.SPC_UPPER_CONTROL_LIMIT_2).LinePlot
This appears to work, is that the intended method? Or is there a better way?
|
 |
|
quinncurtis
1164 Posts |
Posted - 22 Jan 2008 : 14:43:24
|
The control limits are pushed onto a list. The first three items [0, 1 and 2] on the list are used by default in the following order, for the target value, the sigma 3 low control limit and the sigma 3 high control limit. Additional items are in the order they are added.
So if you add the Low Spec Limit, followed by the High Spec Limit, you should be dealing with item indices [3 and 4], for low and high respectively. The value of SPCChartObjects.SPC_LOWER_CONTROL_LIMIT_2 is 3 and the value SPCChartObjects.SPC_UPPER_CONTROL_LIMIT_2 is 4, so your example would work, if you added the Low Spec Limit first, followed by the High Spec Limit. That's just an accident though, based on how we add high and low alarms under the default scenarios.
If you change the order you add the additional alarm limits, high then low for example, your indices would be wrong.
If you only add the High Spec Limit, you are dealing with item index [3]. So you would want to code:
this.PrimaryChart.GetControlLimitData(3).LinePlot.LineColor = Color.Orange;
instead, and skip using the SPCChartObjects control limit constants. |
 |
|
Mike
8 Posts |
Posted - 22 Jan 2008 : 15:41:02
|
OK great. Thank you. |
 |
|
Mike
8 Posts |
Posted - 22 Jan 2008 : 16:02:18
|
One more thing…
Adding the spec limit lines has an unusual side effect in that when I
ChartData.AddNewSampleRecord(samples, noteEntry);
after I have autocalculated the control limits with AutoCalculateControlLimits() AddNewSampleRecord throws the exception “Object reference not set to an instance of an object.”
If I comment out the addition of the spec limit lines it works OK. What do you think?
|
 |
|
Josh
23 Posts |
Posted - 30 Apr 2008 : 16:08:37
|
I recently purchased this software and I'm unable to get the Spec Limit lines to display on the chart. I'm creating an SPCBatchVariableControlChart object and I'm using version 1.7.1.1 of the libraries.
Below is the sub that I'm calling to add the spec limits.
Protected Sub AddSpecLimit(ByVal specType As SpecLimitType, ByVal value As Double, ByVal lineColor As Color)
Dim SpecName As String = IIf(specType = SpecLimitType.LSL, "LSL", "USL")
'Create a new spec limit and set its value
Dim SpecLimit As New SPCControlLimitRecord(Me.ChartData, specType, 0, SpecName, SpecName)
Me.PrimaryChart.AddAdditionalControlLimit(SpecLimit, SPCChartObjects.SPC_MEASURED_VARIABLE, 1)
SpecLimit.ControlLimitValue = value
'Set the color to the spec limit object in the chart
Dim index As Integer = Me.PrimaryChart.ControlLimitData.Count - 1
Me.PrimaryChart.GetControlLimitData(index).LinePlot.LineColor = lineColor
End Sub
Note: SpecLimitType is the following enumeration:
Protected Enum SpecLimitType As Integer
LSL = SPCControlLimitRecord.SPC_LOWERTHAN_LIMIT
USL = SPCControlLimitRecord.SPC_GREATERTHAN_LIMIT
End Enum
The limits and their values are showing up on the right side of the primary chart, but the LinePlots are not visible.
I've also manipulated the index to change the color of Mean and CL's, and it works fine, so it leads me to believe that I'm not doing something correctly to display the LinePlots.
Thanks. |
 |
|
quinncurtis
1164 Posts |
Posted - 30 Apr 2008 : 18:43:18
|
We came out with a major new revision of the software yesterday, which is what you have. Apparently the method of adding specification limits as an additional control limits, as we have described in this and other posts, is now broken. Unfortunately this is not a standard part of the software and none of our example programs test for this capability. We will have to investigate and update the software with a fix that restores this capability, hopefully tomorrow. Sorry for the inconvenience.
We have made an update to the software to fix this problem. You can use your download link to download the current version. Let us know if it works for you. |
 |
|
Josh
23 Posts |
Posted - 02 May 2008 : 16:09:15
|
Sorry, it still doesn't appear to be working.
Do you have an archived DL area that I could use an older version that was known to work; just to make sure it's not my implementation? |
 |
|
quinncurtis
1164 Posts |
Posted - 02 May 2008 : 17:44:58
|
We downloaded the same file that you did to test it and it seems to work for us. We left the test code in the download, commented out. You will find it in the C# TimeVariableControlCharts project, file XBarRChart.cs. Load C# TimeVariableControlCharts project and uncomment the code block below by changing the conditional compiler directive in front of it from false to true. When the program is run it shows up as the initial chart (X-Bar) of the tabbed display. Let us know your results.
// Adding a Specification limit in addition to regular SPC control limits
#if true
SPCControlLimitRecord lcl2 = new SPCControlLimitRecord(this.ChartData,
SPCControlLimitRecord.SPC_LOWERTHAN_LIMIT, 0,"L SPEC", "L SPEC");
this.PrimaryChart.AddAdditionalControlLimit(lcl2, SPCChartObjects.SPC_MEASURED_VARIABLE, 1);
lcl2.ControlLimitValue = 26;
this.PrimaryChart.GetControlLimitData(SPCChartObjects.SPC_LOWER_CONTROL_LIMIT_2).LinePlot.LineColor = Color.Green;
SPCControlLimitRecord ucl2 = new SPCControlLimitRecord(this.ChartData,
SPCControlLimitRecord.SPC_GREATERTHAN_LIMIT, 0,"H SPEC", "H SPEC");
this.PrimaryChart.AddAdditionalControlLimit(ucl2, SPCChartObjects.SPC_MEASURED_VARIABLE, 1);
ucl2.ControlLimitValue = 34;
this.PrimaryChart.GetControlLimitData(SPCChartObjects.SPC_UPPER_CONTROL_LIMIT_2).LinePlot.LineColor = Color.Yellow;
#endif |
 |
|
Josh
23 Posts |
Posted - 05 May 2008 : 08:59:16
|
Thank you very much for pointing me in the right direction with an example. It turns out that I was adding the spec limits after I had added the sample records, which was causing the lineplots to not be displayed.
It's now working fine and including the SL's in the AutoScaleY calculations.
Thank you again for your assistance.
FYI, when I ran the TimeVariableControlCharts project, the SL's were just being drawn over top of the X-Bar line in the primary chart. They weren't being drawn at the correct location. I might take a look later and see if I can find out why. If I do, I'll follow up to this thread. |
 |
|
|
Topic  |
|
|
|