3 Replies Latest reply on May 26, 2011 7:32 PM by dtakara

    Calc Failed on all tags?

    weccsteves

      I have a fairly simple ACE Calculation I've been working on. The logic is set up to make a connection to a SQL database which is then applied to a DataSet.  I loop through the rows of the desired table within the DataSet.  I then have a Select Case that matches specific rows from my SQL query to the appropriate PI TAG, and then sets the Timestamp and Value for each tag.  At one point the calcs were working as expected and populating values when I had a hardcoded connection string for my SQL connection in the AceCalculation sub.

       

      I recently made one minor change to the logic which initializes an XML document object to traverse the associated config file (System.Configuration did not work to read the app.config).  I'm able to read the config file and get an encrypted connection string.  I then have a custom function to decrypt the encrypted connection string.  When running through debug this all appears to works fine. I've been unable to get anything now but Calc Failed.

        • Re: Calc Failed on all tags?
          dtakara

          Hi Steve,

           

          For troubleshooting ACE calculations in run-time, it is best to use calls to method PIACEBIFunctions.LogPIACEMessage to write custom debug messages to the local PI SDK Message Log.

           

          If you need details on how to use this method, check the PI ACE Reference in \Program Files\PIPC\ACE\Help\PIACEReference.chm

           

          In general, "Calc Failed" appears when the value for the output tags remains uninitialized for whatever reason, typically when some exception is raised during the execution of ACECalculations sub.

           

          You may also want to take a look at this Technical Support Knowledge Base Article for more information.

           

          Please keep us posted on your findings.