I have created several Actor Framework examples that I want to share with you. They go from a basic example to an example with packed project library plugins.
All examples have a main application and 2 nested actors : a counter and a timer. They all have the same core functionality but implemented using different concepts.
Each project contains 2 documentation files :
1a | Actor Framework - Basics | Simple 3 actor system with asynchronous messages. |
1b | Actor Framework - Basics with Reply Messages | Example on how to use synchronous reply messages. |
2 | Actor Framework - Subpanel | Example on how to use a subpanel to show a nested actors user-interface. |
3 | Actor Framework - Plugin Parent | Groups common class data and methods of the nested actors in a parent class. |
4a | Actor Framework - Main Interface | Using a main interface class to invert dependency between the main and nested actors. |
4b | Actor Framework - Abstract Messages | Example on how to use abstract messages to invert dependency between the main and nested actors. |
4c | Actor Framework - Main Interface with Unit Tests | Same as 4a but the Counter Actor has unit tests for the JKI VI Tester |
4d | Actor Framework - Main Interface with Reply Msg | Same as 4a but real Reply Msg instead of Request and async Response for "Request Status" |
5 | Actor Framework - Packed Project Libraries | Creating and using the plugins (nested actors) as packed project libraries. |
This is not a step-by-step tutorial but rather a bunch of examples on different Actor Framework concepts.
The pdf gives a short description about each example and states some points of interest.
Hopefully these examples are useful and educational to fellow actor framework coders.
If you have any remarks, suggestions or questions don't hesitate to contact me.
==================================================================================================
EDIT (2019-07-10) :
I have added an extra example "4c. Actor Framework - Main Interface with Unit Tests"
It is the same as "4a. Actor Framework - Main Interface" but now the Counter Actor has unit tests.
This example shows how to use JKI VI Tester for unit testing the messages of an actor.
Remarks :
Thanks to Casey Lamers for his great presentation on "Unit Testing with the JKI VI Tester."
==================================================================================================
==================================================================================================
EDIT (2020-04-29) :
I have added an extra example "4d. Actor Framework - Main Interface with Reply Messages"
It is the same as "4a. Actor Framework - Main Interface" but now the Main sends a real Reply Msg to the Counter and Timer to get the status.
Before it used a request and the plugins replied with an asynchronous message.
In this example the Main uses a Reply Msg which means it will wait for the response. Just added this as an example on how to use abstract Reply Messages.
==================================================================================================
Best Regards
Stefan
Thanks for sharing this code very much!
Very helpful for fresh user of Actor framework!
Stefan thank you for this tutorial, I have been using AF for quite a while, and I like how this goes from basics to advanced concepts.
I have one question, what version of LabVIEW were the PPLs created in? I am working on a project now that I am thinking of using PPLs and I am unable to open them in LabVIEW 2019.
Thanks!
They were created in LabVIEW 2016. So unfortunately they can only be used in that version as you can only make ppl's compatible with future versions starting from LabVIEW2017.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000015AytSAE&l=nl-BE
Thanks so much for sharing, Stefan! Particularly ex no. 5.
I'd been trying to work out how to decouple the plugin actors from the Main Application and the solution was so obvious once I saw it in your implementation - an interface representing the whole Main Application. I'm working on a similar example to yours that replicates what you've done in Actor but for the JKI SMO framework since that's what we use.
Here's my take on PPL plugin based using SMO:
謝謝你的分享,對學習AF的我幫助很大。