7 Replies Latest reply on Oct 27, 2017 9:16 AM by mikael.gidstedt

    CompMax = 0

    mikael.gidstedt

      Hi all,

      I want to turn CompMax completely off so that my tags only get values if new values are sent (no duplicates). Does the setting CompMax = 0 achieve this?

      Lets say that a tag gets the value 1 at time 0. As time goes by, no new values are sent to the tag. What is written to the tag at time 0+1? Null?

      Best regards

      /Mikael

        • Re: CompMax = 0
          Dan Fishman

          You might want take a look at this video:Introduction to Exception & Compression for PI Points The difference between compression and exception can be confusing and there are many KB articles and videos explaining the differences. 

           

          CompMax is amount of time to obey the compression rules.  You actually would use excdev=0 to get all new values except duplicates. Exception configures what is actually sent to the PI Data Historian and compression configures if the value is kept or should be "compressed out".  This is lossy compression.   In your cause, given you have the correct exception, at time 0+1, nothing will be written and the last value is the current value/end of stream value at time 0.

           

          Setting a compdev=0, you could remove all values with same slope.  For example, values 1,2,3,4,5,6 were to be entered at equally spaced time intervals only values 1 and 6 would be "kept" singe the slope is constant (there is not deviation in slope). 

          2 of 2 people found this helpful
            • Re: CompMax = 0
              mikael.gidstedt

              Hi Dan and thank you for replying.

              I have excdev=0 for all these tags.

              You wrote:

              "In your cause, given you have the correct exception, at time 0+1, nothing will be written and the last value is the current value/end of stream value at time 0."

              In our case, the values are exported to another software and it seems that when there are no new values being written to the tag PI is exporting something like this:

                

              2017-10-09 11:00257,3
              2017-10-09 12:00257,3
              2017-10-09 13:00257,3
              2017-10-09 14:00257,3
              2017-10-09 15:00257,3
              2017-10-09 16:00257,3

               

              But what we really want is:

                

              2017-10-09 11:00257,3
              2017-10-09 12:00Null
              2017-10-09 13:00Null
              2017-10-09 14:00Null
              2017-10-09 15:00Null
              2017-10-09 16:00Null

               

              Can this be achieved and how?

              BR/Mikael

                • Re: CompMax = 0
                  Dan Fishman

                  How are you exporting the data? Depending on how you are exporting the data, you can reshape the data at end the time of exporting. 

                   

                  If you want to have it stored in a similar way in PI, you could introduce another tag and use another service such as the analysis or PE service to process the tag.  You can check (event scheduled) if the previous value is the same as the current (prevVal function) then write to a sytem digital state using DigState("Null").  You would also have to create a custom system digital state called "Null".  Of course, if the tag is of type string, you could just write "Null".

                  • Re: CompMax = 0
                    gmichaud-verreault

                    Hi Mikael,

                     

                    What would you want the behavior to be when the next value comes in?

                     

                    2017-10-09 11:00257,3
                    2017-10-09 12:00Null
                    2017-10-09 13:00Null
                    2017-10-09 14:00Null
                    2017-10-09 15:00Null
                    2017-10-09 16:00Null
                    2017-10-09 17:00259

                     

                    OR

                    2017-10-09 11:00257.3
                    2017-10-09 12:00Null
                    2017-10-09 13:00Null
                    2017-10-09 14:00Null
                    2017-10-09 15:00Null
                    2017-10-09 16:00257.3
                    2017-10-09 17:00259