Error when using TagTot in PI AF

Hello,

I am getting an error when trying to use the function TagTot. From the screenshot attached, when Variable1 is added along with the Expression, the following error is returned after clicking on Evaluate.

Attempt by method 'OSIsoft.AN.PerformanceEquation.Evaluation.PENode.ValidateDataMethod(OSIsoft.AF.Asset.AFAttribute, OSIsoft.AF.Data.AFDataMethods, System.Action`1<OSIsoft.AF.Analysis.AFAnalysisException>)' to access method 'OSIsoft.AF.Asset.AFAttribute.IsSupportedDataMethod(OSIsoft.AF.Data.AFDataMethods)' failed.

This is the first time that I am trying to use the TagTot in a Analyses. Any support on this error message would be greatly appreciated. I've also included a screenshot with the PI AF version.
PI AF TagTot function error.png
.
PI System Explorer version.png
 

Thank you,

Emerson

  • My gut feeling is it's related to the ParseTime function and its interaction with 'Shift Start Time'.

     

    Is 'Shift Start Time' tag value stored as a PI Time expression, such as '*' or 't' ?

     

    I believe that's the context that the function is used in. If it is not storing a PI Time expression then you may need to approach this problem differently.

     

    It would be in your best interest to remove variables from your analysis to deduce which variable is causing the problem. Each time you remove a variable, click 'Evaluate' and see if an error is returned in your 'Value at Evaluation' field.

     

    -----Possible Answer Below-----

    I'm not going to delete this preceding comment because it could be informative to some, but I think I actually identified the problem. It looks like you're using your tag value for 'Shift Start Time' in the Variable1 expression, but I think you want to use the calculated evaluation of Variable1 (ShiftStartTime).

     


    image.png
     

    Look here:

     


    image_1.png
     

    Notice the distinct lack of ' ' around ShiftStartTime? That's because it's using the variable evaluation, instead of your 'Shift Start Time' tag

     

    Hope that helps!

  • Thank you. We're are looking at upgrading our PI system in the next few weeks. Hopefully that will take care of this error

  • I agree with ​ that Shift Start Time is where you should focus. Pity you do not provide sample values to aid us in providing a better answer.

     

    Although some consideration should also be given to whether Calc Work Order is stepped or interpolated.

     

    I am totally guessing here, but I would suspect that Shift Start Time is a time-of-day, e.g. "06:00". Another way to store that would be as relative PI Time of "+6h" - note the PLUS sign is super important as it lets the Analytics parser know it is a relative time. However, you would need to ParseTime as Concat("t", 'Shift Start Time') in that case.

     

    And yet another alternative is to stored Shift Start Time as a double with UOM of Hours. For 6:30 AM, it would be stored as 6.5 hours. In the analysis, you would perform an offset in seconds and add it to Today. Something like:

     

    StartTime = 't' + Convert('Shift Start Time', 's')

  • I'd like to add that the versions you're using for AF Server and Client has some serious known bugs to it, so I would really recommend upgrading to a newer version, at least you should see something with 2018 on it.

     

    We were doing an AF refurbish project for a client back in 2018, and beacuse of their IT policy they didn't plan on upgrading from 2015 anytime soon. Eventually, I had to make an ultimatum that we'd not be doing any AF work for this customer unless they upgraded to at least 2016 R2. In 2015, I'd constantly lose data, it happened multiple times that my last 2-3 hours of work just disappeared - even if I had checked my changes in. So please, do yourself a favor and get something newer.

  • Thank you, everyone. I created an new Analyses and I still get the same error, and as it can be seen on the second screenshot below, the tag Actual Good Units return good value on a different Analyses. I believe that our version of AF does not have support for this function, maybe ?

     


    image.png

    image_1.png

  • Did you try a configuration with my recommendation where you use the variable 'ShiftStartTime' (your variable 1) instead of the tag value 'Shift Start Time' that I think I see in Var3, maybe Var4, and Var5?

    Looks like the error relates to OSIsoft.AF.Asset.AFAttribute.IsSupportedDataMethod so I'd think that means related to the data method of the the calculation on either a tag being calculated (current state) vs a variable AF attribute (what would be used if you swap to 'ShiftStartTime' ) being calculated.

  • Yes, I did try your recommended configuration and I still get the error code.

    Thank you !

    Emerson

  • Your version numbers are VERY OLD. Is there any chance that you can upgrade:

     

    AF Server

    AF Client

    PI Data Archive

     

    Also, I suggest you try to use 64-bit PI System Explorer instead of 32-bit, if possible. The Analysis Service runs as 64-bit, so you should try to mimick that environment as close as possible.

     

  • Hi Rick,

    Yes, we're in the process of upgrading our PI Servers. I am hopeful that the Tagtot function will work after upgrades are in place.

    Thank you,

    Emerson