Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How nested actor report error to caller ??

Solved!
Go to solution

Ok so I have another question.

How to report error from nested Actor to caller actor. I wat to build reusable actor for example cylinder actor. And I want to send to caller information about self. Information are Busy and user error 5001 timeout.

I thinking about this:

1. make 2 abstract message one for update Busy state and second for User error ?

2. make 1 abstract message what will be update caller about self. This update message contain in cluster information Busy and Fail flags. After I do not use standard error strategy for user error but I use flag like in evaporative cooler exam, error from dual fan send by update message to caller.

How to check other error in actor? Because if in Actor occurred an error, "Handle Error" stop it.

How caller actor know that callee is stopped? I want to know why stopped.

It is anybody here who tell me how to handle error in Actor framework ?

Thank you.

0 Kudos
Message 1 of 7
(5,388 Views)
Solution
Accepted by reteP

You can report a nested actor's error to its caller in two ways.

1.  If you don't want the nested actor to stop, override the nested actor's Handle Error.vi.  Use the Report Error message to send that error to your caller.  Any actor can receive a Report Error message; the message simply injects the error in to the receiver's error stream.  The caller will now seem to have that error message, and you can handle it in an override of the caller's Handle Error.vi.

To send this message, use Send Error Report.vi, which is on the Actor Framework » Advanced palette.

2.  If you want to let the nested actdor stop on error, the caller will get the nested's error for free.  When an actor stops, it sends a Last Ack message to its caller; this message contains, among other things, the nested actor's final error state.  You can override the caller's Handle Last Ack Core.vi to handle this error. Last Ack also contains the final state of the *actor*, so you can get other state data as well.

The accessor VIs that let you get data out of a Last Ack message are on the actor Framework palette.

Message 2 of 7
(4,491 Views)

Thanks a lot, this is a really helpful explanation. You should write the vi documentations. I never used the Report Error VI because I did not know, that the error can be injected so easily to the callers error stream. Stop Actor and Emergency Stop also throw an error. I think this should be handled seperatly. At least I want to stop my actor when it receives stop.

0 Kudos
Message 3 of 7
(4,491 Views)

Thank niACS,

I have labview 2012 and I am not sure if is there Report Error message in AF was shipping in labview 2012 ??

I do not want the nested actor to stop only for user error 5001 timeout because this is not fatal error for system it is error on unit and this unit go back and try again.

For example cylinder actor behavior:

caller send to cylinder run and direction for exam go to front on cylinder are two sensors one for rear and one for front position. Cylinder has timelimit if is elapsed time occure timeout and if is flag Retry cylinder go to back (rear side) and if is ok no timeout occurred try again go to first position Front.

If occurs in actor another error Actor stop and I want to know why Actor stopped because is good know for debug.

0 Kudos
Message 4 of 7
(4,491 Views)

How do other people determine which Actor injected the error into the callers Actor error stream when using the Send Error Report VI?

Especially in programs where I have launched several instances of the same Actor running in parallel I have problems with this issue. When the Actor shuts down and sends a Last Ack Msg I can use the Read Caller-To-Actor Enqueuer, but when using the Send Error Report I am losing this information.

0 Kudos
Message 5 of 7
(4,491 Views)

Option 1: Encode information in the Source string... when you're writing down the source of the error, include the actor as part of the source.

Option 2: Use unique error codes... doesn't help much when you have multiple actors of the same kind.

Optoin 3: Create a new message class to encode more information. The Error Report is for very simple types of error escalations... you may need to create a more robust version for your case.

0 Kudos
Message 6 of 7
(4,491 Views)

Actually, with regard to my last, it just occurred to me that there is no way for the receiver to use the enqueuer. So that probably would not work.

0 Kudos
Message 7 of 7
(4,491 Views)