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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Actor Framework for Dummies

Solved!
Go to solution

I've been studying Actor Framework for three days now, and I still cannot make sense of any of it.  I've looked at all the tutorials I can find from NI and other sources, but I cannot seem to take the theoretical knowledge and match it with the practical applications.

Does anyone know of a "Remedial Actor Network" tutorial that would take me through building a VI slowly, step-by-step, while explaining everything that is going on at every step of the process?

Thank you very much.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
Message 1 of 15
(22,525 Views)

Hi,


@diarmaede wrote:

I've been studying Actor Framework...


Good for you! The Actor Framework regularly seems to be described as very difficult to understand or work with, but I think that it is an architecture in which although there is some up-front cost, once you have some understanding it becomes possible to build ever more complex systems without ever more complicated code.

 

I would however suggest that the Actor Framework template is not the greatest learning tool. Some resources I found helpful were:

  • The Actor Framework group on the forums. This used to have a nice collection of pinned documents if I recall correctly - these seem to have vanished when the forums were moved.
  • The Using The Actor Framework pdf. This is linked to on the link below, and is pretty detailed. It describes quite a few things that can be stumbling blocks in getting started.
  • READ THIS FIRST to get started with Actor Framework. This is a link to one of the previously pinned documents in the forum group. It has a bunch of other links, but I think the highlight is the pdf above.
  • David Moore has a good guide beginning here. It is a 4-part tutorial with an additional walkthrough. The 4th part describes helper loops, which are pretty much indispensable for a lot of common uses.
  • Actor Framework Basics. This might already be below the level you're looking for - it describes what different parts do, and holds your hand through their creation, but doesn't describe too much why you want to do anything.

If you're looking for a more useful (in my opinion) example than the template, then Matt Pollock's Coffee Shop example described in this thread is really pretty good (although a bit more complicated, you get to see it do something). I'm not certain if there are minor bugs in the code when you try to do strange things, but it's certainly illustrative of a way to group sets of actors together to do something nice. It also demonstrates the benefit of actors being independent - you can have a bunch of separate customers each as a new instantiation of the same actor-inheriting class. I've placed an image of the class hierarchy below with some comments to incentivise taking a look!

 

coffeeHierarchy.png


GCentral
Message 2 of 15
(22,492 Views)

Wow!  What a fantastic response.  TYVM!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 3 of 15
(22,336 Views)

These are great resources cbutcher! I'll also add that I think another super important thing when first learning the actor framework is do NOT try to understand HOW it works. Don't open up any of the parent methods, you will get confused with all the details of how actor framework is implemented, but all you actually need to know is how to use it. This can be fun to learn about later but don't let it stop you from using it. In fact, the whole point of a framework is to make it so you don't need to worry about all those details. Just imagine you are sending messages from one actor to another through a magic portal.

0 Kudos
Message 4 of 15
(22,301 Views)

@HopeH wrote:

These are great resources cbutcher!


Glad you like them - especially since half of them are written by some of your very helpful and kind colleagues at NI! (or previously at NI...)

 

I'll also add that I think another super important thing when first learning the actor framework is do NOT try to understand HOW it works. Don't open up any of the parent methods, you will get confused with all the details of how actor framework is implemented, but all you actually need to know is how to use it. This can be fun to learn about later but don't let it stop you from using it. In fact, the whole point of a framework is to make it so you don't need to worry about all those details. Just imagine you are sending messages from one actor to another through a magic portal.

Respectfully (and knowing it puts me in terrible company - I'm pretty sure I've seen AQ write exactly what you've written numerous times) I disagree. Although it's certainly true that an advantage of a framework is making things work without you having to reinvent the wheel or fully understand how all of the pieces work, I'd like to suggest that with the Actor Framework, one of the great strengths is that if you're confused about how or why something works as it does, the answer is only a few double-clicks away. 

 

Many of the framework VIs have detailed comments. There are more in the Actor side than the Message side, but once you have the Message Maker worked out (here right click is much better than double click!) you should be ok with messages until you try to use batch messages or reply messages.

 

With batch messages and reply messages, both of which are outside of the suggested use of the framework, there are some specific guides you can use. For reply messages, the hand-holding tutorials are actually much more useful - the difficulty isn't understanding the concept so much as making the mechanics work.


GCentral
Message 5 of 15
(22,284 Views)

Hello,

you can take a look at https://github.com/HB-GSI/Calculator which is an introduction to the NI Actor Framework implementing a simple UPN-Calculator by LabVIEW Champion Holger Brandt with 7 exercises

UliB

Message 6 of 15
(22,211 Views)

In addition to tips given above:

  1. Become familiar with the concept of zero coupling messages  so soon as possible. This will allow You to implement realy independent and reusable actors.
  2. If You use LV2014 or below, please install AF Message Maker Project Provider. This will make your live much more convenient.
Message 7 of 15
(22,189 Views)

I just saw a new link on LinkedIn to an AF document describing tools used to create sequence diagrams to display messaging.

 

It looked so useful that I wanted to share it here. 

 

It probably isn't the beat learning tool, but you could use it on the example projects already mentioned to create example diagrams which might help explain their workings if diagrams are a form you prefer.

 

https://forums.ni.com/t5/Actor-Framework-Documents/Actor-Framework-Sequence-Diagram-Parser/ta-p/3536...


GCentral
Message 8 of 15
(21,943 Views)
Solution
Accepted by topic author diarmaede
Message 9 of 15
(13,870 Views)

Hi Tom,

 

Wow!  Fantastic videos!  By far, the best explanation of the practical applications of Actor Framework that I have ever seen. Thanks very much for your post!  I look forward to watching more of your vids!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
Message 10 of 15
(13,810 Views)