13 Replies Latest reply on Apr 21, 2015 8:34 AM by Nicolas.Isambourg

    [PI-SQC] How to configure the minimum data points before triggering of the alarms

    Nicolas.Isambourg

      Hello,

       

      I'm developing a .NET application embedding the PI-SQC control chart of PI-ProcessBook through PI-ActiveView.

      I want no alarm to be triggered until there are 5 data points on the SQC control chart.

      How can I configure it on the SQC control chart ?

      Here are the configuration:

       

      var spcDefinition = spcTrend.GetDefinition();
      
      spcDefinition.ChartType = ChartTypeEnum.sqcIndividuals;
      spcDefinition.SetCalculationBasis(SamplingTypeEnum.sqcEventBased, 1, 1, null, null, null);
      spcDefinition.SetVerticalScale(ScaleTypeEnum.sqcCenterline5Sigma, ScaleTypeEnum.sqcCenterline5Sigma);
      spcDefinition.SigmaCalcMethod = SigmaCalcEnum.sqcSigmaRange;
      
      // Alarms configuration
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmOut3Sigma, true, 1, 1);
      // Disable others alarms
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmOut1Sigma, false, 1, 1);
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmOut2Sigma, false, 1, 1);
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmOutPlusMinusSigma, false, 1, 1);
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmSideOfCenter, false, 1, 1);
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmTrendUpDown, false, 1, 1);
      spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmWithin1Sigma, false, 1, 1);
      
      
      spcDefinition.SetPlotTime(StartTypeEnum.sqcAbsoluteTime, DateTime.Now.ToString("dd/MM/yyyy HH:mm"), "*");
      
      
      spcTrend.SetDefinition(spcDefinition);
      

       

       

      Thanks for your help,

      Best regards,

      Nicolas

        • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
          bshang

          Hi Nicolas,

           

          I believe one option is to use the "Minimum data points needed to generate a valid Sigma option". Graphically, it is located under the Data Filter tab for the SQC symbol. Programmatically, you can set it via the SetSigmaFilter method.

           

          SetSigmaFilter (ByVal iValidPoints As Long, ByVal bEliminate As Boolean, ByVal dSigmaMultiplier As Long)

           

          For example, the method call would look like:

           

          spcDefinition.DataFilter.SetSigmaFilter 8, True, 2.0

           

          This would set a Sigma Filter with a minimum of 8 points and eliminate the samples that are outside 2*Sigma from the center line.

           

          To update the definition, you would need to end it with

           

          spcTrend.SetDefinition(spcDefinition)

           

          which you are already doing.

           

          There are some further descriptions of the SetSigmaFilter method in the PI SQC Programmer Reference.

           

          Would this option meet the requirements? By requiring a minimum number of points for a valid sigma, then no alarms can be triggered before that number as no valid sigma exists to compare against existing alarm criteria.

          • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
            Nicolas.Isambourg

            Hello Barry,

             

            thank you for replying to my discussion.

            I called the SetSigmaFilter method as below:

             

            spcDefinition.SetSigmaFilter(4,false,1);
            

             

            Suppose the control limits are configured as below:

            UCL=100

            LCL=0

            CL=50

             

            I configured 1 SQC pattern test:

            spcDef.SetPatternTest(AlarmTypeEnum.sqcAlarmOut3Sigma, true, 1, 1);
            

             

            I resetted the SQC control chart then I added the following values:

            1. 104
            2. -8
            3. 94
            4. 34
            5. -108

             

            After each adding, I checked the alarm status of each data point.

            After adding of the first value:

            1. 1st data point, alarm: -1

             

            After adding of the second value:

            1. 1st data point, alarm: -1
            2. 2nd data point, alarm: -1

             

            After adding of the third value:

            1. 1st data point, alarm: -1
            2. 2nd data point, alarm: -1
            3. 3rd data point, alarm: -1

             

            After adding of the fourth value:

            1. 1st data point, alarm: -1
            2. 2nd data point, alarm: -1
            3. 3rd data point, alarm: -1
            4. 4th data point, alarm: -1

             

            After adding of the fifth value:

            1. 1st data point, alarm: 0
            2. 2nd data point, alarm: 0
            3. 3rd data point, alarm: -1
            4. 4th data point, alarm: -1
            5. 5th data point, alarm: 0

             

            I attached a screenshot of the SQC control chart after addition of the 5 data points.

             

            Is it normal a such behaviour ?

             

            Thanks,

            Best regards,

            Nicolas

            • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
              Nicolas.Isambourg

              Hi Barry,

               

              Here is the PDI file.

               

              Thanks,

              Best regards,

              Nicolas

                • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                  bshang

                  Hi Nicolas,

                   

                  I looked at the PDI and there were SQL alarm tags specified in the Upper Control Limit, Center Line, and Lower Control Limit fields within the Control Parameters tab. I believe this may be why the first two points did not show alarm states. Could you change the UCL, Center, and LCL to 100, 50, 0, respectively? Then, the first two events should show alarm. To figure out why they did not in the case that the alarm tags were used, we'd need to look at the actual values of the SQC tags that denote the limits. Since the two initial points did not show alarm but the fifth point did, I would guess for example that the LCL value was lower than -8.

                    • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                      Nicolas.Isambourg

                      Hi Barry,

                       

                      sorry, I think there is a misunderstanding. I made a mistake.

                       

                      Suppose the control limits are configured as below:

                      UCL=100

                      LCL=0

                      CL=50

                       

                      In my .NET application, I also configured a PI tag for each control limit. It is the same tags as in the SQC symbol configuration in the PDI.

                      However, in the PDI, I replaced the tags by static values. The behaviour is the same. I mean the first two events don't show alarm.

                       

                      Thanks,

                      Best regards,

                      Nicolas

                        • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                          bshang

                          Hi Nicolas,

                           

                          I looked at your PDI again. I think the issue was the Transition Data Filter setting under the Data Filter tab in the PI-SQC Chart Definition. A filter was applied to the alarm calculation to begin calculating after 4 events were received. Hence, the first two violations were not calculated. You can get the first two to show alarm by unchecking the Alarm Calculation box as shown below.

                          transition.PNG

                          You may or may not want to use the Transition Data Filter. It will depend on the use case requirements, but some more details are provided in the Live Library here

                          Transition Data Filter

                            • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                              Nicolas.Isambourg

                              Hello Barry,

                               

                              Indeed, when I uncheck the Transition Data Filter setting in the PDI, the first 2 events show alarm.

                               

                               

                              In my .NET application, I apply the transition data filter to the alarm:

                               

                              spcDefinition.SetTransitionFilter(TransitionFilterEnum.sqcApplyToAlarm, 4, false, 20, SampleRelativePositionEnum.sqcRelativeEachOther);

                               

                              So, the first 2 events shouldn't show alarm. However, they do it.

                               

                              Thanks,

                              Best regards,

                              Nicolas

                                • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                                  bshang

                                  Hi Nicolas,

                                   

                                  I created a test display and could not reproduce your issue. You mentioned that applying SetTransitionFilter programmatically does not work and still shows the first two points as in alarm?

                                   

                                  I've attached a sample PDI using the configuration we've been using. There are only two VBA functions/macros to turn on/off the alarm via buttons.

                                   

                                  Sub ApplyAlarmFilter()
                                  
                                  
                                  Dim spcDefinition As SQCSymbolDefinition
                                  
                                  
                                  Set spcDefinition = SQCSymbol1.GetDefinition()
                                  
                                  
                                  spcDefinition.SetTransitionFilter sqcApplyToAlarm, 4, False, 20, sqcRelativeEachOther
                                  
                                  
                                  SQCSymbol1.SetDefinition spcDefinition
                                  
                                  
                                  End Sub
                                  
                                  
                                  Sub RemoveAlarmFilter()
                                  
                                  
                                  Dim spcDefinition As SQCSymbolDefinition
                                  
                                  
                                  Set spcDefinition = SQCSymbol1.GetDefinition()
                                  
                                  
                                  spcDefinition.SetTransitionFilter sqcApplyToNone, 4, False, 20, sqcRelativeEachOther
                                  
                                  
                                  SQCSymbol1.SetDefinition spcDefinition
                                  
                                  
                                  End Sub
                                  

                                   

                                  If possible, could you provide the full section of the code in the .NET application where spcDefinition is being modified? Is the spcDefinition being correctly applied afterwards to the correct SQC symbol?

                        • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                          dng

                          Hi Nicolas,

                           

                          Have you found a solution to this issue? If so, please mark the answer that helped you as correct; otherwise, you can give us more details so we can further assist you.

                          • Re: [PI-SQC] How to configure the minimum data points before triggering of the alarms
                            Nicolas.Isambourg

                            Hello,

                             

                            thank you for replying.

                            Sorry, I was not available these last weeks.

                            I tested your PDI. I understood the transition filter parameter.

                             

                            I attached the screenshot of an other SQC control chart example.

                             

                            Screenshot_TESTSPC.png

                             

                            The UCL, LCL and CL are PI Tags whose values are 31, 28 and 30.

                            I want an alarm to be triggered when there are at least 4 data points and a value is outside control limits.

                             

                            I applied the same parameters as previously.

                            On the screenshot, you will see that only the last point is red.

                            I don't understand why the other points aren't red.

                            Which values do I need to apply to the sigma and transition filter parameters ?

                             

                            I hope I'm clear.

                             

                            Thanks,

                            Best regards,

                            Nicolas