From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-20-2012 05:06 PM
I'm just curious if anyone has any thoughts about best practices for creating a centralized error handler in the actor framework. The main concern I'm struggling with is whether to put all the error handling within my top level actor (first image) or should it be its own actor (second image). Any thoughts/suggestions are appreciated. Thanks.
12-20-2012 07:13 PM
I would recommend using the "Handle Error.vi" in Actor Framework. There is a class too called "Report Error Msg" that may be in the experimental fork of AF that you can use to send an error that happens in an actor to the actor's caller. Often it is useful to tell the caller of the actor about the method about the error and have the caller handle the error. That would mean that you would need to override the Handle Error.vi in the callee to tell the caller about the error and then override the Handle Error.vi in the caller to actually handle the error.
I have additionally built a data logger actor that you can send an error message and the class name of the actor and write it to a log file. In that scenario I have a separate actor for error logging. I pass the queue reference for the logger to my component actors so they can send an error message in their override of Handle Error.vi.
Hope some of these ideas help. I plan to post some actors that I have written to the community at some point, just too busy with other work currently.
Casey
Phoenix, LLC
CLA, LabVIEW Champion
Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!
12-20-2012 07:21 PM
CaseyLamers1 wrote:
I plan to post some actors that I have written to the community at some point, just too busy with other work currently.
I suspect that lots of us are thinking the same thing! Some week I'll get the time to clean up all my reuse code, document it lightly, and publish it for others to use!
01-07-2013 03:18 AM
There is a Structured Error Handler Reference Library which seems to be a good candidate for a central error handler actor.
In the discussion forum Oli Wachno already suggested to turn it into an actor. I also feel it could fit the Actor Framework.
If I were you I would try to change the Central Error Handler of it into an actor and change the incoming errors into messages. I have no idea if it would be easy or not, so sorry if it leads to a dead end.
01-07-2013 08:54 AM
The SEH uses an FGV for error handling. That will break the true asynchronicity of Actors running alongside each other. As such, I recommend against using it for a central error handler. I'm also unsure whether NI Systems Engineering plans to maintain that library any further.
Moore Good Ideas has an error logging/reporting library on the VI Package Manager servers that I used in my AF extension class, and it's working very well so far. It uses a queue in Windows and an RT FIFO in LVRT for pushing errors to a dynamically launched central handler.
01-07-2013 01:09 PM
For now I've decided to use the Structured Error Handler library to filter and categorize errors and then pass those errors back up the tree using an error message class in the handle error VI of each actor. The error handling logic will be in the handle error vi of the top level actor.