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: 

Unable to message another actor (can message self)

Hi all

 

This is also posted at https://decibel.ni.com/content/thread/17117. But since personally wasn't aware of the Actor Framework community I thought I'd post it here as well. My appologies if it is not acceptable.

 

I'm in the process of learning the Actor Framework and after studying the "Evaporative Cooler"-example I've gone ahead and tried to make a test/example my self. I am however unable to send messages to other actors. I can send messages from a given actor to the same actor. Below is the headlines of what I'm doing and the problem:

 

I have to actors: actor A and actor B. Both actors have task which only purpose is to launch a one button dialog with a message - actor A's method is called Task A.vi and actor B's method is called Task B.vi. Messages for these tasks have been created using the Actor Framework Message Maker and I've changed nothing compared to what the message maker made.

 

The purpose of my test/example is to have actor B be able to invoke Task A.vi (and get a dialog saying "Task A: <included message>") and invoke Task B.vi (getting a dialog saying "Task B: <included message>"). To do this actor B needs the message enqueuer of actor A.

 

To handle this "sharing" of actor A's enqueuer Actor B has as it's private data a Message Enqueuer. After launching the two actors in my main.vi I use an method of Actor B called Bundle A Message Enquere To Self.vi. This method simply takes an message enquere as input and bundles it by name into actor B ('s private data). This is an exact copy (as far as I can tell, but I could be mistaken since something is not working) of what is done in the "Evaporative Cooler"-example.

 

Actor B overwrites it's Actor Core.vi. This overriding vi calls it's parent method and presents two buttons ([Send to self] and [Send to A]) for triggering the sending of Task B to B itself or Task A to actor A. When sending to B itself ("Send Task B.vi") I use B's own message enqueuer - obtaining it by calling Read Self Enqueuer.vi. When sending to actor A ("Send Task A.vi") I unbundle B's private data called "A Message Enqueuer", which is (or should be) A's message enqueuer, and use that for seding "Send Task A.vi".

 

However the only thing that works is seding messages to B itself. If I press [Send to self] I get a nice popup with the message "Task B: <included message>". If I press [Send to A] nothing happens. I've tried to put int some dialogs in Do.vi of both Task B and Task A (saying "Hello from Task A do.vi" and "Hello from Task B do.vi") and only the dialog of Task B gets shown. So it's like Do.vi of Task A never gets executed.

 

Please find attached screenshots of all VIs and the VIs themselves. To run the project simply run main.vi it launches Actor B's actor core front panel which is the gui to send messages from. To stop it again press [Stop] on main.vi's frontpanel.

 

Thank you for reading through and hopefully helping me.


Best regards
Jonas C. Jeppesen

 

 

0 Kudos
Message 1 of 3
(2,138 Views)

Hi Jonas

 

It looks like you got a lot of good answers to this questions on the actor framework community.

 

Do you see this question as resolved? If not please let me know if I can underline some of the points in the thread.

 

 

Best regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 2 of 3
(2,081 Views)

Double post.

0 Kudos
Message 3 of 3
(2,081 Views)