3 Replies Latest reply on Mar 29, 2016 8:35 PM by Jerome Lefebvre

    Displaying max tag value in ProcessBook

    bsawkins

      Hi, I am trying to display the highest temperature value from a list of ~30 stator tags. I have tinkered with PI Calculation within ProcessBook and put expressions together, but have not been able to get anything comparing over 5+ tags to be able to work ( I am also limited within the expressions window and not able to expand the window to edit long expressions). I figure I may need to write some VBA behind the scenes to get the expression I want to work, but was wondering if anyone has any tips for me? FYI, I am relatively new to the PI system and have been utilizing youtube a lot as my learning tool.

       

      Thanks,

       

      Ben

        • Re: Displaying max tag value in ProcessBook
          Jerome Lefebvre

          Hello Ben,

           

          I agree that the window to edit data set is fairly limited, but in the case of creating a long list and taking the Max, I would simply type in : Max( then start using the tag search window and find a tag I am interested in, then after making sure I am at the end of the text (saying entering the cursor and then hitting control+end), I would type in a comma and then search for the next tag. Once done again all the tags, I would then enter in the closing bracket ). This can let you build the list quickly, without too much typing.

           

          If you later need to edit that list of tag and can't find the tag name, it is possible to copy and paste it into an external editor and then do the editing there.

          The Performance Equations SMT addin also has similar limitations, but it does offer a slightly large editing window and a evaluate button to check your calculation.

           

          Cheers,
          Jerome

            • Re: Displaying max tag value in ProcessBook
              bsawkins

              I thought the Max command would give the highest temp over the course of a time interval (7 days seems to be the norm) and not the current max temp. I guess it is also dependent on how often you get the data set to run the calculation (I have it set for 5 mins)... Anyways, it looks to be working! Thanks for the help, Jerome.

               

              Ben

                • Re: Displaying max tag value in ProcessBook
                  Jerome Lefebvre

                  Hello Ben,


                  In PE tags or digital set, when you use something like 'sinusoid', it is actually a short hand for TagVal('sinusoid', '*'), thus the value of the tag sinusoid at the particular moment where it is called. Thus, it is simply a single number and not the underlying real time series data itself.

                  So, when you call Max('sinusoid', 'cdt158'), it is really taking the maximum of two values, e.g. the max function has no concept of what a real time series is.

                   

                  If you want to take the Maximum of several tags over several days, then you would need to first call TagMax on each of the tags you are interested in and then take the max of that set of values, for example Max(TagMax('sinusoid', '*-7d', '*'), TagMax('cdt158', '*-7d', '*'))

                   

                  Cheers,

                  Jerome