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 Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

AF Basics Article

I put together a series of articles while working on an AF 101 presentation for our local CLD summit. Check them out and let me know what you think or if you have any questions/improvements.

Derek

Message 1 of 19
(9,559 Views)

A lot of times you don’t just want a QMH, you want a Producer Consumer type architecture. This is achieved in AF by overriding the framework method called “Actor core”.

How do I do this?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 19
(6,603 Views)

Logger Test Main_BD.png

I can see how to override Actor Core.vi, but not how to use it.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 19
(6,603 Views)

This is what I've got, and the error I get.

af.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 19
(6,603 Views)

In your top level launching VI you put the actor you want to launch as the input to the launch root actor. Do not put an actor core in there. The only output is an enqueuer. This is how you interact with the actor. Put messages on the enqueuer.

So, from the above code, just remove your call to actor core before the call to launch root actor.

Casey

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

Message 5 of 19
(6,603 Views)

Thanks for writing this overview up. I will point people to it.

Casey

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

0 Kudos
Message 6 of 19
(6,603 Views)

Thanks for writing this article! Im currently struggling to learn AF and this has been the biggest help so far. I'd also recommend this example that I feel like complements this guide very well: http://www.labvolution.com/labview-actor-framework-basics/

The reason I say that is because in that example it shows you how to handle front panel input.

Thanks for taking the time to create and share this!

0 Kudos
Message 7 of 19
(6,603 Views)

I have a following question:

Assuming I have a Helper Loop in the main Actor Core.vi with an Event Structure.   Upon pressing a button, even structure launches a Nested Actor (which happens to be a timer, executing the 'Time Delayed Send Message' to a message class who's Do.vi is in turn executing the Public Method, which reads the self enquer and runst 'Send Normal Stop'.

The problem is - the actor is not stoped, I can see with the Monitor Actor app, it's still running.

Is my logic conceptually wrong here?

0 Kudos
Message 8 of 19
(6,603 Views)

rsmrostov wrote:

I have a following question:

Assuming I have a Helper Loop in the main Actor Core.vi with an Event Structure.   Upon pressing a button, even structure launches a Nested Actor (which happens to be a timer, executing the 'Time Delayed Send Message' to a message class who's Do.vi is in turn executing the Public Method, which reads the self enquer and runst 'Send Normal Stop'.

The problem is - the actor is not stoped, I can see with the Monitor Actor app, it's still running.

Is my logic conceptually wrong here?

In LV2015 where Launch Nested Actor takes the Parent Actor as an input, you'll want to send a message from the Helper Loop to Parent Actor and call Launch Nested Actor in a method of Parent Actor.

In LV2012, Launch Actor only needed Actor-to-Caller Enqueuer. You could launch a nested Actor from your Helper Loop, but would have to send it a Stop message as with any other actor.

Jason

0 Kudos
Message 9 of 19
(6,603 Views)

rsmrostov wrote:

I have a following question:

Assuming I have a Helper Loop in the main Actor Core.vi with an Event Structure.   Upon pressing a button, even structure launches a Nested Actor (which happens to be a timer, executing the 'Time Delayed Send Message' to a message class who's Do.vi is in turn executing the Public Method, which reads the self enquer and runst 'Send Normal Stop'.

The problem is - the actor is not stoped, I can see with the Monitor Actor app, it's still running.

Is my logic conceptually wrong here?

I don't think I understand what you ARE doing, and what you're TRYING to do, but I don't think they're the same thing.

Can you post a snipped of your actor core with the relevant event case?

0 Kudos
Message 10 of 19
(6,603 Views)