ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone provide a simple demo how to use Last Ack Messages?

Solved!
Go to solution

If you want an example, I use them in the Measurement Utility code.  I believe they're handled when a Measurement finishes in order to handle any errors (been a few months since I looked at the code), but they're definitely in there in several locations.

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 11 of 14
(1,120 Views)

Like I said, this is probably fairly obvious to others, but I actually had to look at what was going on.  In my case, I had the launch actor vi error out running to the actor core error in which caused the actor core of the caller to immediately bomb.  Just poor error handling - in this case, the launch actor VI was attempting to launch a device that used a serial port that was not available.  The case was not catastrophic so I didn't intend for the calling actor to close - I just wanted to let the caller know via the last ack that the actor it had launched was not available.  I corrected this issue, but I had to dig into the lower level VIs to really understand exactly why the last ack was not handled as it was not immediately apparent to me from the documentation.

Cheers, Matt

0 Kudos
Message 12 of 14
(1,120 Views)

I'll take a look at the documentation. That's useful feedback.

0 Kudos
Message 13 of 14
(1,120 Views)

This is a screen shot of how I use this method in the Controller Actor of the Measurement Utility.  If a nested actor doesn't return an error upon shutting down, the first two images illustrate how I use the method to ensure certain operations are performed: if it's a configuration actor that shut down without error, I save the configuration (to a file on disk) - if it's a measurement actor that shut down without error, the controller's private data is modified to reflect that the measurement has been completed successfully.

The last image illustrates what happens if a nested actor did shut down with an error.  I designed the system so that no nested actor can shut down the controller.  As you can see, the error is recorded and thrown away so that the controller keeps running.

2014-06-09_20-16-09.png

2014-06-09_20-10-49.png

2014-06-09_20-17-01.png

Elijah Kerry
NI Director, Software Community
Message 14 of 14
(1,120 Views)