3 Replies Latest reply on Mar 11, 2015 11:56 AM by gregor

    PI ACE not writing calculation results to PI

    asif.manzoor

      Hello,

      I am developing some calculations in ACE. I need to get PI Tags to be used in calculations from outside source , create PIACETag and stores its reference into an Object array for later use. I am doing in as below. I am doing this in InitializePIACEPoints

       

      For Each node In list

       

         Try

       

        arrMappings(cntWellTag, 0) = node.Attributes.GetNamedItem("Name").Value()

       

        arrMappings(cntWellTag, 1) = New PIACEPoint(Context, node.Attributes.GetNamedItem("Choke").Value(), TagAliasUsedType.TagAliasAsInput)

       

        arrMappings(cntWellTag, 2) = New PIACEPoint(Context, node.Attributes.GetNamedItem("P1").Value(), TagAliasUsedType.TagAliasAsInput)

       

        arrMappings(cntWellTag, 3) = New PIACEPoint(Context, node.Attributes.GetNamedItem("P2").Value(), TagAliasUsedType.TagAliasAsInput)

       

        arrMappings(cntWellTag, 4) = New PIACEPoint(Context, node.Attributes.GetNamedItem("T").Value(), TagAliasUsedType.TagAliasAsInput)

       

        arrMappings(cntWellTag, 5) = New PIACEPoint(Context, node.Attributes.GetNamedItem("CV").Value(), TagAliasUsedType.TagAliasAsOutput)

       

        arrMappings(cntWellTag, 6) = New PIACEPoint(Context, node.Attributes.GetNamedItem("CF").Value(), TagAliasUsedType.TagAliasAsOutput)

        

         Catch ex As Exception

       

         End Try

       

         Next

       

       

      Under ACECalculations, I am getting saved PIACEPoints references to read PI Tag values , using them in calculation to obtain results. This is going good. However I am unable to write results to the PI Tags. No error shows up nor I get output tags values updated in PI. Below is the code

       

       

       

      tmpACEPoint = arrMappings(cntWell, 5)

       

        tmpACEPoint.Value(System.DateTime.Now) = CVValueCalc

       

        tmpACEPoint.PutValue()

       

        boolDataSentoPI = tmpACEPoint.SendDataToPI()

       

       

      In debug mode when I look at tmpACEPoint, it shows me pointing to correct PI Tag where it is supposed to write. Any help ???

       

      Regards

      Asif

        • Re: PI ACE not writing calculation results to PI
          sdriscoll

          Some troubleshooting steps that may be helpful in this situation.

           

          You said "no error shows up". An important distinction is where you are referencing that statement from? The ACE node or the PI Data Archive node?

          - If the ACE node, look to see if there are any messages on the PI Data Archive node because those would be more indicitive of a write issue.

          - If on the PI Data Archive node, then that means either:

              a. the connection isn't making it to the PI Data Archive node (unlikely since you say you are getting "saved PIACEPoint references")

              b. the connection from PI ACE is being given privledges that do not have write permissions. In this case no errors are thrown and the values that are attempting to be written are just dropped. Check in Network Manager Statistics to find out what sort of privledges a particular conneciton has.

              c. the compression settings may be set in such a way that you aren't seeing the data you intend

           

          This is also not considering buffering. If buffering is enabled then you will have to look for a connection from that on the PI Data Archive rather than PI ACE.

            • Re: PI ACE not writing calculation results to PI
              asif.manzoor

              Hello Sean,

              Thanks for giving very useful tips that will be handy for troubleshooting.

               

              The issue is resolved when instead of using

               

              arrMappings(cntWellTag, 1) = New PIACEPoint(Context, node.Attributes.GetNamedItem("Choke").Value(), TagAliasUsedType.TagAliasAsInput)

               

              I used

               

              tmpPIACEPoint = New PIACEPOINT()

               

              tmpPIACEPoint .SetTag(Context, node.Attributes.GetNamedItem("Choke").Value(), TagAliasUsedType.TagAliasAsInput)

              tmpPIACEPoint .SendDataToPI= true

               

              I am still working on it but I guess we need to set SendDataToPI=true at the the time of PIACEPoint initialization in InitializePIACEPoints().

               

              Regards

              Asif

                • Re: PI ACE not writing calculation results to PI
                  gregor

                  Hello Muhammad,

                   

                  I understand Sean's reply helped you to find a solution for your issue. Therefore, please allow me marking your question as "Assumed Answered". Please do not hesitate to post again on this thread if you need further help.” If one of the posts contains the sufficient answer to your question / issue, please consider marking it as "Correct Answer"