10 Replies Latest reply on Aug 17, 2018 1:55 PM by sraposo

    Analysis will not write ouput

    Johnny.bjanesoy

      Update & Edit: The problem has become more clear after further debugging and rewriting so post is edited to support this

       

      I have a bit conundrum with my AF Analyses

      I have a custom symbol in PIvision that switches the value of a PIpoint from 1 to 0 and vice versa on click. It does this through a GET and PUT request to the webID of the point.

      The purpose is activate some analyses running on the AF server. After a given time, an analysis is supposed to set the value to 0 through Output Attribute mapping.

       

      It does however not write any values. The mapping is correct, code checks out and it evaluates correctly but no value is saved. Same for Periodic instead of Event-Triggered.

      Code in question is simple:{      If(timeSinceLastUpdate > timer) Then 0 Else NoOutput()      } where the variables are simple integers defining time.

       

      So far I cannot understand why this should be an issue but I suspect that since I am updating the value from my custom symbol, some measure in AF prevents the analysis from writing the value.

      Anyone got any info on this?

       

      AF Version 2.10.0.8628

        • Re: Analysis will not write ouput
          TimCarmichael

          Have you confirmed your custom symbol is updating the snapshot and archive for the affected point?

          Is your AF analysis writing to the same point or a different point?

          • Re: Analysis will not write ouput
            sraposo

            Hi Johnny,

             

            As a general rule of thumb, PI Points that are outputs to Asset Analytics should not be written to by any other application. There are several reasons, for example:

             

            1) Asset Analytics uses a local data cache. If there are any dependent analyses or recursive logic, Asset Analytics will not make an RPC call to the PI Data Archive and will use the values in cache instead. In other words, Asset Analytics will not use the values written to by another application.

             

            2) Recalculating the analysis will delete any values written by an application that is not Asset Analytics

             

            etc....

             

            The above however does not explain why your analysis wouldn't trigger. When a value is written from PI Vision, what timestamp is written to the PI Point. Is the data coming in order? Is the Timestamp changing?

             

            Thanks,

            Seb

              • Re: Analysis will not write ouput
                Johnny.bjanesoy

                Thanks for the info. I'm fairly new to the Pi software so still learning how to properly operate the system.

                 

                The timestamp from the custom symbol is time of update, so '*'. The timestamp is changing whenever I click the button and time series show that each update is saved, so nothing appear to be wrong on that end.

                  • Re: Analysis will not write ouput
                    sraposo

                    In that case it should trigger the analysis. Do you have a PI Data Archive collective or a single PI Data Archive?

                     

                    If you have a collective, does the data get updated on all members? A possibility here is that the Analysis Service would be connected to a different member that isn't receiving the data.

                     

                    If you don't have a collective or if the data is the same on all members, the next step would be to look at the analysis logs with trace set on the Data Retrieval and Evaluation logger. We can provide the steps on enabling the trace setting.

                     

                    Thanks,

                    Seb

                      • Re: Analysis will not write ouput
                        Johnny.bjanesoy

                        There are some data collectives in our system but not any that is concerned with the servers I'm operating on. The custom symbol is operating on another server's PIvision and WebAPI if that is a consideration.

                        I'm going to go for the method of using the custom symbol to perform the reset since that should in theory work and be a better practice.

                         

                        I am however quite curious what the cause of this conflic is for potenial projects in the future so please send me the steps needed for tracing the data.

                          • Re: Analysis will not write ouput
                            sraposo

                            Hi Johnny,

                             

                            There are 3 .exe used by the PI Analysis Service. The pianalysisprocessor.exe performs real time calculations. For this type of situation, I would set Trace on the DataRetrieval and the Evaluation loggers. You can do this by modifying the config file %PIHome64%Analytics\PIAnalysisProcessor.exe.config. The change would be from:

                             

                            <rules>

                                  <logger name="OSIsoft.AN*" levels="Fatal" writeTo="eventLog" />

                                  <logger name="*:Evaluation" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Scheduling" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Recalculation" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:DataRetrieval" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Configuration" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:External" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Matlab" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Performance" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:PerformanceEvaluation" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:ExternalStatistics" minlevel="Info" writeTo="externalStatistics" final="true" />

                                  <logger name="OSIsoft.AN*" minlevel="Info" writeTo="logfileAsync" />

                                </rules>

                             

                            To

                             

                            <rules>

                                  <logger name="OSIsoft.AN*" levels="Fatal" writeTo="eventLog" />

                                  <logger name="*:Evaluation" minlevel="Trace" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Scheduling" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Recalculation" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:DataRetrieval" minlevel="Trace" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Configuration" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:External" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Matlab" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:Performance" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:PerformanceEvaluation" minlevel="Info" writeTo="logfileAsync" final="true" />

                                  <logger name="*:ExternalStatistics" minlevel="Info" writeTo="externalStatistics" final="true" />

                                  <logger name="OSIsoft.AN*" minlevel="Info" writeTo="logfileAsync" />

                                </rules>

                             

                            Be careful when modifying the config file, making a mistake could make the pianalysisprocessor.exe inoperable!

                             

                            Once this is done, you can reproduce the issue. In your case simply update the PI Point from the PI Vision symbol.

                             

                            You can then search in the logs located: %ProgramData%\OSIsoft\PIAnalysisNotifications\Logs\pianalysisprocessor-log.txt

                             

                            Easiest way to search in the logs is to use the Full Path of the analysis. You can get the full path by right clicking on the analysis and selecting Copy. This will copy the path to your clipboard. You can then use a text editor to search through the file. As a suggestion, I use Notepad++ as there is a "Find All" feature and I can retrieve all the messages for a single analysis in one search.

                             

                            Finally after doing, set the loggers back to Info! The logs with Trace set on some loggers will consume a lot of disk space quickly. Given that the default location of the logs is on the C: drive, it's very important to set these loggers back down to Info once the troubleshooting is done.

                             

                            Hope this helps,

                            Seb