Actor Framework Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Beginner Tutorial: Zero-Coupled Actor Project

This is the step-by-step tutorial promised for zero-coupled actors and abstract messaging. While there are probably better projects to illustrate those concepts, the aim of this tutorial is to match the original project as closely as possible. Thus,in this project a Test Actor takes two numbers as input and sends them in messages to an Addition and Multiplication actor. Those actors then carry out the calculations and send the results back (in messages again) to the Test Actor for display.

Actor Diagram.png

The Actor Class diagram:

Actor Hierarchy.png

The message hierarchy is shown next. There are probably other ways to implement the abstract/child message classes, but I've decide to go this way. In any case, the main point is to understand the flow in creating the messages, which I think the tutorial does.

Message Hierarchy.png

Finally, I also show two ways of defining the child class in the program. The first is to define the child message type at actor launch:

1_4_updated.jpg

The second approach is to "inject" the child message type at run-time.

1_5_updated.jpg

Comments obviously welcome. This was a somewhat difficult document to write, so some errors may remain.

Comments
ecarey
Member
Member
on

Thanks for this DMurray, any chance you could back-save it for LV2013 SP1 and provide a link? 

G_Method
Member
Member
on

I like this example.. Good starting point for understanding abstract messaging. Any reason the abstract Calculation Result Msg parent send method execution is non-reentrant? Why not set reentrant as there is no state data and is called by both Add and Multiply nested actors running in parallel?

DMurrayIRL
Member
Member
on

Apologies, I've just seen these posts. Something odd going on with my NI account since the migration last year. I also can't reply to these messages individually for some reason, so here's my responses:

 

ecarey: The Actor Framework API changed enough between LV2013 and LV2014 that the tutorial only makes sense for versions LV2014+.

G_Method: The default in LabVIEW Actor Framework is that VI's are non-reentrant, and I don't understand enough about the low-level functionality to feel confident about changing anything. I can't remember the exact reasoning for non-reentrant operation- perhaps one of the original designers of AF can comment?  

 

justACS
Active Participant Active Participant
Active Participant
on

Reentrancy adds overhead which can cost more than the savings from having truly parallel code.  That makes it something best applied deliberately, rather than preemptively.

luismi911
Member
Member
on

 Excellent tutorial DMurrayIRL, thank you very much!

 

A minor silly observation, could it be that using the Actor Framework tools and scripts included since LV2015+, could simplify the routine actor and message creation you explain in the tutorial? I know you made this using LV2014, but maybe for future revisions of the document, it could save you several pages :).

Suda苏打!
Member
Member
on

wow! thanks,thank you share this document,but could you share Actor Framework Basics (1) ?

EDB22
Member
Member
on

Thank you!!!

CanadaGuy
Member
Member
on

This tutorial is exactly what I was looking for in decoupled messaging (callee to caller). I implemented my own code (and wrote some notes) on how to do it using the build in message maker functions for abstract and children messages using the "inject at runtime" method. It works well, and doesn't require much manual intervention. This should be required reading for AF learning for reusable actors.

Contributors