5 Replies Latest reply on Jan 6, 2015 3:04 PM by gregor

    [PI-SQC] The alarm event is never raised

    Nicolas.Isambourg

      Hello,

       

      I'm developing a .NET application embedding PI-SQC.

      I want to be notified when a new SQC alarm occurs.

      I subscribed to the alarm event.

      But, this event is never raised. I don't understand why.

       

      What are the conditions for the alarm event be raised ?

       

      Thanks,

      Best regards,

      Nicolas Isambourg

        • Re: [PI-SQC] The alarm event is never raised
          gregor

          Hello Nicolas,

           

          By default PI SQC is using point source Q. Does your application sign up for updates for points with point source Q? Do you like to share your code?

            • Re: [PI-SQC] The alarm event is never raised
              Nicolas.Isambourg

              Hello Gregor,

               

              I realize my post wasn't clear enough.

              Actually, I want to use the PI-SQC control chart of PI-ProcessBook in my .NET application through the use of PI-ActiveView.

               

              Code:

              private SQCSymbol AddAndConfigureSQCSymbol(Display display)

              {

                   // Ajout du Trend au display

                   SQCSymbol.SQCSymbol sqcSymb = (SQCSymbol.SQCSymbol)display.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolSQC);

                   if (sqcSymb != null)

                   {

                       sqcSymb.Alarm += new EPISQCSymbol_AlarmEventHandler(sqcSymb_Alarm);

                       sqcSymb.DataUpdate += new EPISQCSymbol_DataUpdateEventHandler(sqcSymb_DataUpdate);

                       sqcSymb.DataRefresh += new EPISQCSymbol_DataRefreshEventHandler(sqcSymb_DataRefresh);       

               

                        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;

                        spcDefinition.SetPlotTime(StartTypeEnum.sqcSamplesBeforeEnd, 20, "*");

                        // etc.

               

                        sqcSymb.SetDefinition(spcDefinition);

                   }

              }

              private void sqcSymb_Alarm()

              {

              }

              private void sqcSymb_DataRefresh()

              {

              }

              private void sqcSymb_DataUpdate()

              {

              }

               

              When a new value is added to the SQC symbol, the sqcSymb_DataRefresh and sqcSymb_DataUpdate methods are called.

              When a new SQC alarm occurs, the "spcSymb_Alarm" method is never called.

               

              Thanks,

              Best regards,

              Nicolas

                • Re: [PI-SQC] The alarm event is never raised
                  gregor

                  Hello Nicolas,

                   

                  I've checked the events of the SQC symbol with ProcessBook 2014 (3.4.0) and found that the Alarm event is not firing but DataRefresh and DataUpdate do. This confirms your observations.

                  I will get in touch with ProcessBook development to figure out why the Alarm event is not firing. If this turns out to be a bug, I wouldn't expect an immediate solution. Therefore I've looked for a possible workaround.

                  You can check for the Alarms.Count property within the DataUpdate event and add some logic that tells you if the DataUpdate includes a new Alarm.

                  1 of 1 people found this helpful
                    • Re: [PI-SQC] The alarm event is never raised
                      Nicolas.Isambourg

                      Hello Gregor,

                       

                      thank you very much for the help.

                      According the PI-SQC manual, the SQCSymbol Object Alarm Event occurs if the last data point is an alarm and the End Time of the PI-SQC is the current time (*).

                      I setted the plot time like this:

                      spcDefinition.SetPlotTime(StartTypeEnum.sqcSamplesBeforeEnd, 20, "*");

                       

                      So, the End Time of the PI-SQC should be the current time.

                       

                      I will implement the workaround that you've suggested.

                       

                      Thanks,

                      Best regards,

                      Nicolas

                        • Re: [PI-SQC] The alarm event is never raised
                          gregor

                          Hello Nicolas,

                           

                          It turns out the Alarm event is not properly implemented with the SQC Symbol. Development suggested using GetAlarm which returns alarm details but only for the latest alarm raised. This can be an issue when alarms are coming in frequent and you may prefer using Alarms.Count

                          You have discovered a bug that affects only a few users and there exists a workaround. We don't want to raise expectations and leave them unfulfilled. Because of the reasons mentioned before it is very unlikely that the issue will be addressed in the future. Hence no WI / PLI has been created. We will however request Technical Support to log a case for you so the issue becomes documented in our call database.

                           

                          Please accept our apologies for the inconvenience.