16 Replies Latest reply on Feb 12, 2015 6:11 PM by dng

    How to replace a values with ABACUS?

    tboers

      The use case is where we have one measurement for multiple
      devices, say 4 for this example. In the field each device is measured for a
      time period, let say 4 hours. After these 4 hours the next device is measured.
      In PI we have 4 tags, one for each device. In the end result we like to have a
      trend with values ONLY for the measured period of the device. The customer does
      not want to add tags for this purpose. Also the customer likes to be able to
      calculate over the values. 

       

      We are thinking to use Abacus for this. We can have the PLC
      set a value to the output e.g. -99 when the device is not measured.  I looking to REPLACE this -99 values with a STATUS
      (e.g. bad value) in Abacus. Here I’m running in to two problems:

       

      1. How can I set the status Bad Value?

        if ‘tag01’ = -99 then ? else ‘tag01’
      2. How do replace the value? The above add’s a value
        to the history. Event–based does not work as the source tag is the same as the
        output. If scheduled and set the output tag  to “by –time = Exact time” we get the error
        message”  “The data method ‘Updatevalue’
        is not supported on attribute ‘tag01’”

       

      Guessing the new version of Abacus were you can control the
      output write time is helpful, but actually we are looking for a solution before
      Q2 2015.

        • Re: How to replace a values with ABACUS?
          Roger Palmen

          Hi Tjidde,

           

          1. To get "Bad Value" as the output value, you should use DigState("Bad Value")
          2. You can't.

           

          But you could resolve this on-the-fly with some creative use of the Formula DR within AF.

          • Re: How to replace a values with ABACUS?
            pthivierge

            Hello Tjidde,

             

            If I understand well, you want to visualize 4 data series on a single trend line?

            With a PICalcuation in processbook (Tools-Datasets) you might be able to combine your 4 tags into one without using more tags if you know precisely what are the time periods that correspond to each of your tags.

            Once its complete, you can add the PICalc to your Trend:

            2015-02-11_14-59-20_PI ProcessBook - [Display1_].png

             

            Example: After 12.00 I want the value of CDT158 instead of sinusoid.  I simply use this PE:

            if hour('*')>12 then 'CDT158' else 'sinusoid'

            You could adjust that calculation (performance equation syntax) to add more tags and more time periods.

            2015-02-11_14-56-36_PI ProcessBook - [Display1_].png

            • Re: How to replace a values with ABACUS?
              lmlcoch

              You could use PI ACE if you need solution right now. PI ACE can do everything you describe in your original post.

              If you decide to go for PI ACE, let me know - I can come up with an example.

              • Re: How to replace a values with ABACUS?
                dng

                Hi Tjidde,

                 

                Rather than having Asset-Based Analytics replacing the -99 with "Bad", can you configure the PLC to send bad quality or under range data instead? Some interfaces (e.g. OPC DA interface) have a questionable quality flag that you can use to your advantage to store the quality instead of value.

                  • Re: How to replace a values with ABACUS?
                    tboers

                    Indeed a solution where we can give the status via the interface is prefered. Unfortunatly we are using Modbus E and not OPC DA. Do you know of a solution how to pass on the status or validation via Modbus E?

                      • Re: How to replace a values with ABACUS?
                        dng

                        Hi Tjidde,

                         

                        Ah... I don't believe ModbusE send quality data like the OPC DA interface. However, there are several system digital states that will be written to ModbusE tags that we can possibly use. E.g. If the interface receives a floating point value that corresponds to "Not a Number" (NAN) or an infinite value, Invalid Data is written to the input tag (according to the ModbusE 4.0.7.98 manual). I'm not too familiar with your PLC, but is this possible to configure?

                    • Re: How to replace a values with ABACUS?
                      shillman

                      You might try something like:

                       

                      IF 'Tag01' = -99 THEN NoOutput() ELSE 'Tag01'

                       

                       

                      This way nothing will get written when the tag has a value of "-99". Otherwise, another solution, as previously suggested, would be to use logic to check if/when the tag is measured.

                      • Re: How to replace a values with ABACUS?
                        bshang

                        Hi Tjidde,

                         

                        If I understand correctly and you would like to visualize the 4 data streams as one trend line, one way to do this as Roger mentioned is via Formula data references.

                         

                        For example, you can create a formula data reference called A such as

                        if 'tag1' == -99 then 0 else 1

                         

                        Create four of these (A,B,C,D). One for each measurement stream. 0==inactive and 1==active

                         

                        Then create another formula reference that works like a dot product. This will be the condensed stream.

                        A*'tag1' + B*'tag2' + C*'tag3' + D*'tag4'

                         

                        As long as only one tag is active at any point in time, then the formula DR will represent the condensed stream. Otherwise, you may get some weird peaks and valleys.