14 Replies Latest reply on Jun 18, 2018 7:51 PM by BillBPA

    Multiple future values in a trend

    BillBPA

      I have future value tags which receive multiple values for a time stamp which results in this type of trend.  I would like to only trend the newest value.

      I don't want to create a second tag holding the current value, so what options are there?  If I use an AF analysis without mapping to a pi tag, it will fill the SQL DB with values which isn't desirable.

       

         Example set of values for one time stamp.

      12-Jun-18 08:00:00-14.7
      12-Jun-18 08:00:00-17.8
      12-Jun-18 08:00:0023.1
      12-Jun-18 08:00:00-11.4
      12-Jun-18 08:00:0020.7
      12-Jun-18 08:00:004.5
      12-Jun-18 08:00:0035.3
      12-Jun-18 08:00:00-4.4
      12-Jun-18 08:00:009.4
      12-Jun-18 08:00:0017.9
      12-Jun-18 08:00:0029.1
      12-Jun-18 08:00:0019.6
      12-Jun-18 08:00:0023.7
      12-Jun-18 08:00:0042.4
      12-Jun-18 08:00:002.8
      12-Jun-18 08:00:0037.8
      12-Jun-18 08:00:00-5.6
      12-Jun-18 08:00:00-1.2

       

      Bill

        • Re: Multiple future values in a trend
          gmichaud-verreault

          Are the other events relevant, or only the last one to come in?

          • Re: Multiple future values in a trend
            rschmitz

            I'd be interested in seeing what this looks like in PI System Management Tool's Archive Editor for this tag. Even future tags shouldn't have multiple events for one timestamp. If the events were coming in with a single timestamp I would expect the value to be substituted and marked as such. Perhaps we could take a look at the source data (however it maybe coming in) and make sure that there aren't millisecond differences in the timestamps, which are making these unique events. If we can prevent the data source from adding on millisecond differences, we can ensure only the most recent value to come in is the only one retained.

             

            --Rob

            1 of 1 people found this helpful
              • Re: Multiple future values in a trend
                BillBPA

                As you can see, no substituted values and the highlighted values are the final latest value.

                 

                All values need to be retained so the shifting predictions are captured for later analysis.

                  • Re: Multiple future values in a trend
                    rschmitz

                    So even if you're seeing identical timestamps in SMT with your current settings, that doesn't mean you aren't displaying sub-seconds. These are still unique events with unique timestamps. So for example, if I query for the following two events for a tag using the Windows Format for time (which is what it looks like you currently have set), they appear to have the same timestamp

                     

                    However, if in SMT I go to View > Settings > Time Format and switch it to the settings below:

                     

                     

                    I see that these events in fact do have different sub-second timestamps

                     

                     

                    That being said, if you need to retain all values to capture shifting predictions, this inherently won't work because Processbook will trend all timeseries values in the range you ask for. You're either going to need a second tag with filtered data or to write your own visualization tool/symbol to change this behavior.

                     

                    --Rob

                • Re: Multiple future values in a trend
                  tramachandran

                  When you say that all the events have the same timestamp how do you classify the 'newest value'?

                  If it is possible to configure the data source, you should specify AFUpdateOption.Replace for data writes. This will ensure if any values exists at the same time, the new values overwrite them and set its Substituted flag.

                  • Re: Multiple future values in a trend
                    Roger Palmen

                    Just from the data in PI you cannot know which value is the 'latest', and therefore this is in principle unsolvable if you whish to store all values in PI and not just the latest. I suggest to look at your process how you create these values and find a solution there.

                    1 of 1 people found this helpful
                      • Re: Multiple future values in a trend
                        BillBPA

                        I know what order the values are shown in SMT or Datalink are the order they are received.  I've confirmed this by watching new values come in and where they are shown in the column.

                        Also, the PB trend shows the last value that was received by the horizontal line connecting the vertical lines representing the range of values.

                        Also, if I use Datalink to return a timed value, interpolated returns the last value whereas exact returns the first value.

                         

                        So perhaps there's a way of using a data set to return the latest value, but since it's an element relative display, that won't work.

                         

                        The data comes from a third party.  I have little influence on how they time stamp the data and I'm not the only one capturing the values for use.  I may be able to do something with the interface that is receiving the values.

                          • Re: Multiple future values in a trend
                            Roger Palmen

                            Like in most databases, there is no guarantee that the order of display is the order in which the data is received. Ever tried archive reprocessing, PI2PI interfaces, etc?

                            It is try that it is quite likely that data is shown in order of receipt, but likely is not enough to solve this problem. I really think you either have too much data, or too little.

                        • Re: Multiple future values in a trend
                          BillBPA

                          So, I have created a solution I was looking.

                          I created a data set that is just the tag value but the sync time is 00:00:01 so it get the latest value and calculation interval of one minute.

                          Ta da!

                          For extra credit, I created a context change event and update the data set with the tag name associated with the selected element.