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.

Actor Framework Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Actor Framework from basic to PPL plugins

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 :

  • Documentation.html : an html page which contains an overview of all project items and their documentation
  • Class Diagram : a text-file containing a plantuml class diagram of the project. This can be opened by using the PlantUML Viewer plugin in Google Chrome or on the website www.planttext.com

 

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 :

  • Run Test Suite : runs the test suite without opening the VI Tester and saves a JUnit XML file to the users desktop
  • TestSuite's New.vi : lists all TestCase*.lvclass files relative to the TestSuite
  • TestCase's setUp.vi and tearDown.vi : take care of creating and destroying the "actor queues FOR TESTING ONLY"

 

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

Comments
KaiZhang
Member
Member
on

Thanks for sharing this code very much!

Very helpful for fresh user of Actor framework!

SHowell-Atec
Member
Member
on

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!

Appreciate constructive criticism, it is there to help you succeed.
StefanLemmens
Member Member
Member
on

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

Nathan-M
Member
Member
on

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.

Nathan Murphy
Nathan-M
Member
Member
on
Contributors