3 Replies Latest reply on Sep 17, 2018 1:09 PM by Rick Davin

    Total Tank Level

    gorez69

      Hi Everybody.

      I want to congratulate YOU! Today is 256 day.

      And i have a question.

      How calculate common weight from month in TANK. Level into tank can be increase, can be decrease. I have conditions then increase - input valve is open, then decrease output valve is open. (in the same time valve can not open). For example Tank install on the weight cell. And i get data in mass measurement.

      I know how calculate it with help PI DATA LINK. I can not to make AF calculate. And I do not want to use Event Frame, although may be somebody use and know how Event Frame value move to PI Archive tag. ?

        • Re: Total Tank Level
          Rick Davin

          Hello Konstantin,

           

          I have moved your post to All Things PI because it lacked having code to justify being in PI Developers Club.

           

          Do you not have a continuous measurement of tank percent full (or tank percent empty)?  Is the only related measurement you receive truly a UOM from the Mass class?  I find that odd because short of a tank percent fill, I normally would expect a Volume to know how much liquid is in the tank.  It's Mass (or weight) would require knowing more about the density of the liquid.

           

          To calculate a percent level based on Volume requires knowing meta data about the tank.  Is the tank shape a cylinder, bullet, or sphere?  Is the tank orientation vertical or horizontal? What is the height or length of the tank?  What is the diameter or radius?  Each answer would require a different set of calculations, some easier than others.  Typically for most plants, these calculations would be done at the DCS reading the Volume.  Then the PI interface would read that calculated value from the DCS just as if it were an instrument reading.

          1 of 1 people found this helpful
            • Re: Total Tank Level
              gorez69

              I have already had measurement from TANK in mass. I have matrix tank, i have value about density. I can to calculate percent to mass.  But my question about calculate TOTAL for month for TANK. I want to know how much ton charge (filling) for month and how much ton discharge (emptying) for month.

                • Re: Total Tank Level
                  Rick Davin

                  Hi Konstantin,

                   

                  Are you trying to skimp and save on tag counts, which makes the a possible solution either very difficult or horribly slow, or do you have freedom to create tags as outputs from Asset Analytics?  I don't think you need event frames.

                   

                  You have 2 valves: input and output.  It sounds like logically that one is the negative of the other.  That is Input is open, Output is closed, and vice versa.  As long as both cannot be open or both cannot be closed at the same time, you can treat them in a binary manner.  You don't need a new tag for this, you would just look at either the Input valve being open or closed to decide if the tank is filling or discharging.  Alternatively, you could look at the Output valve instead.

                   

                  Using one of the valve's to decide the tank's Filling/Discharging state, I would suggest trying to calculate a DAILY value for both 'Daily Filling Mass' and 'Daily Discharge Mass'.  This requires 2 new PI tags to be used as outputs from an Analysis.  Then for a MONTHLY calculation, you would need yet another 2 new output tags ('Monthly Filling Mass' and 'Monthly Discharge Mass').  The monthly calculations will be much faster since they will be grabbing at most 31 daily values each.  This also gives you the benefit of being able to see a partial monthly calculation quickly, or perhaps only recalculating for a specific day if the need arises.

                   

                  If you are an EA customer with virtually unlimited tags, you could create a new tag to hold the binary tank state (filling vs discharging).  This could be a Boolean, an integer 1 or 0, but I would recommend it be a digital state.  I would have 3 states (0 = None, 1 = Discharging, 2 = Filling).  The None state would be used in case the Input/Output valve has a bad value.  You should try to set up the Analysis to update this state tag only on a change in state, which means NoOutput() is your friend. 

                   

                  Again, you don't need event frames for this.