8 Replies Latest reply on Mar 1, 2018 9:17 PM by Maryelis

    Values in a trend

    Maryelis

      Good Afternoon

       

      Is there a way to change the method that trend plot the values in PI Process Book? I'd like obtain in a trend with all values save in a tag. In other words, that the trend use the Compress Data Values and not the Sample Data.

       

      Thank you.

        • Re: Values in a trend
          KenjiHashimoto

          Have you tried Markers checkbox?

          It shows marker on the compressed values. Using this option and if the trend does not have enough space for showing a lot of events, then it will not show markers for that span, so it is possible to recognize that it comes from compressed values or not.

            • Re: Values in a trend
              Maryelis

              Hi.

              Yes, I use marker option, but when I tried to view a lot of days don't show me the compress data in the trend.  I can verify that because I use the property VB "TraceValuesCount" to obtain the count of point in the trend and is less than the rows in one consult with compress data in PI Datalink or if I see the option "Show Details and Annotations" in ProcessBook.

              Is there a way to always see all the values (compress data) in a the trend without take the count of days or resolution? Can I configured this in ProcessBook?

              Thanks for your help.

                • Re: Values in a trend
                  KenjiHashimoto

                  ProcessBook's trend uses plotvalues method, because the trend pixel (width) is limited.

                  If the trend is expanded width of the trend, then it can show more events.

                  I believe there is no settings for showing all compressed values in the trend.

                  Because if it is possible, the users could not see the line as line shape (it should show multiple vertical lines for showing such a lot of events).

                  Why do you want to see a lot of compressed data within the limited width of the trend?

                  You can see the compressed values by View > Details as a table.

                    • Re: Values in a trend
                      Maryelis

                      Hi.

                      We tried to do one aplication that show a series of trend and with programing VB show some calculations. The information that we are using for do the calculations are the values of trends, but when we see the results for the calculations, there are not good, because show some desviations. We think is because with don´t have all values in the trend.

                       

                      Do you hown some manual that we have find documentation that can explain how works the trend? A manual that mention that trends use plotvalues?

                      Thanks.

                        • Re: Values in a trend
                          KenjiHashimoto

                          From design base, PI ProcessBook trend does not show all compressed values.

                          However, there are multiple ways to get compressed values from PB VBA.

                          I think it is easier than using PI trend data.

                           

                          For example, reference PI SDK 1.3 Type Library.

                          This is a sample code to get compressed values by PI SDK.

                          Visual Basic Editor > Tools > References > Check PISDK 1.3 Type Library, PITimeServer 1.0 Type Library

                          Sub csv()  
                          Dim myPIServer As PISDK.Server  
                          Dim pt As PIPoint  
                          Dim pvsstarttime As PITime  
                          Dim pvsendtime As PITime  
                          Dim pvs As PIValues 
                          Dim val As PIValue  
                          Set myPIServer = PISDK.Servers.DefaultServer  
                          Set pt = myPIServer.PIPoints("cdt158")  
                          Set pvsendtime = myPIServer.ServerTime  
                          Set pvstarttime = pvsendtime.Clone  
                          '1 hour data  
                          pvstarttime = pvsendtime - 3600  
                          Set pvs = pt.Data.RecordedValues(pvstarttime, pvsendtime, btAuto)  
                          For Each val In pvs  
                              ' should be able to see val.TimeStamp.LocalDate and val.Value
                          Next 
                          End Sub 
                          
                          

                           

                          PI SDK is old technology but it works with current version of ProcessBook.

                           

                          You can also use PI Web API to get recorded values from ProcessBook VBA.

                          Announcing PI Web API Wrapper for VBA

                  • Re: Values in a trend
                    Rick Davin

                    Hi Maryelis,

                     

                    It's not really a Compressed Data versus Sampled Data issue.  Rather it's an issue between PlotValues versus RecordedValues.  For best performance and efficiency, ProcessBook uses PlotValues, which can greatly reduce the number of data values while maintaining high integrity of visualizing the trend.  As Kenji Hashimoto  has shown, you probably want to grab the RecordedValues directly rather than grabbing PlotValues from a trend.

                    1 of 1 people found this helpful