fabiano.batista

Error handling in PI ACE

Discussion created by fabiano.batista on Jan 26, 2012
Latest reply on Jan 30, 2012 by fabiano.batista

Hello everyone,

 

I am writing a PI ACE calculation to take the information from a single tag to send to several other tags. It is a sort of "demultiplexer" basically. I am using a PI ACE funtion "FindEQ", that may fail when it does not find a given value in my search window (as expected). So to deal with this fact I had to use the Try...Catch commands.

 

When I started my PI ACE calc, I noticed that the "Try ... Catch" statements were ignored by PI ACE executable. In other words, I get a calc failed even if the error falls inside a Try... Catch. I found somewhere in the PI ACE training documentation a recommendation to use the "On Error .. Go To" command, but there was no mention to the "Try.. Catch" command. But aren't they equivalent commands?

 

Another question is regarding the error monitoring. I tried to log Exception Error messages into the PI ACE log, but I any of my custom messages appeared in the local PI SDK log file. Here is the command I used:

 

OSIsoft.PI.ACE.

 

PIACEBIFunctions.LogPIACEMessage(OSIsoft.PI.ACE.MessageLevel.mlUserMessage, ex.Message, Context)

 

What am I missing here?

 

Any help will be appreciated. Thanks a lot!

Outcomes