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: 

message not coming to main actor

Solved!
Go to solution

I am sending a message from the child actor to parent actor. The message is not showing in the parent actor. But if I m using a brakepoint to check then it is coming. Can u suggest me a solution of this.

0 Kudos
Message 1 of 5
(2,974 Views)

You are doing something wrong.  I know that's pretty obvious, and you really want to know what you are doing wrong, but without knowing what you are doing (specifically,. seeing, and potentially testing, your LabVIEW code), it is pretty hard for anyone to spot the error ...

 

Bob Schor

0 Kudos
Message 2 of 5
(2,928 Views)

 Sir thanks for the reply.

I am attaching the code. I am sending a message (boolean T/F) from UI actor to main actor.

When you press the start button in the UI front panel it will send the mssg to main. To check the message i opened the main actor core. There the message is not coming. To check when i put a break point in the start event of the main core, then the message is coming. Can you plez explain what is the cause?

0 Kudos
Message 3 of 5
(2,817 Views)
Solution
Accepted by topic author souvikG

You need to remember that the running actor core of any actor is a clone. You can't just open the actor core of a running actor from the project and expect that you open the clone that is running, it doesn't work like that. 

Message 4 of 5
(2,746 Views)

You're not sending an event. You're sending a message using the actor's enqueuer, and that message reaches where you want - it goes to Actor:Actor Core, which in your actor is above the loop. If you go in that VI and place a probe, you should see the message.

 

Note that it's generally a bad idea to have more than one communication channel to an actor, as it can lead to a lot of confusion. In this case, if you want to pass data coming into the actor to your own loop, you can trigger the event in the message's Do VI, so that when the actor receives it, it will be the one triggering the event and no other actor even knows the second loop exists. This can lead to code which is harder to write or debug, but is safer and easier to understand from outside the actor. The same should apply to the stop messages - use the enqueuer to send the stop messages to the actor and have each actor stop its messages internally.

 

One additional point - it's generally also a bad idea to split an actor wire, because the actor is by value - the only wire which holds the current actor state is the one which is inside Actor Core, so you can't rely on the duplicate wire. If you do want to update the actor's state from the second loop, send it a message (which does require splitting it. It's fine if that's all you're doing). If you are only sending it a message, then it's also fine that you actually split the actor wire before it got the other enqueuer values, because you're not going to use them from your loop. If you do plan on doing that, you need to take a later version of the actor which does have them.

 

If you plan on using the AF, I suggest you look at the Actor Framework group in the communities area, because there you will a lot of discussions on the topic.


___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(2,743 Views)