LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Actor Framework : Send message from Actor A to Actor B (NOT via caller)

Hi All,

 

I am new to actor framework and I am stuck at following point.It will be great if you could show me the way through.

 

What I did ?

 

I can send can receive to and from caller (using read caller’s Enqueuer).

 

I created a small example for that (attached project in  LV2015)

 

Three actors

 

Main Actor core.vi  : This will launch ‘Actor A’ and ‘Actor B’

 

I can send Data from Actor A ---toà Main Actor ----to-à  B (using Read caller’s Enqueuer).

 

 

What I wish to do?

 

What I can do is to send data from Actor A –---to--à to Actor B directly.

 

How to get message Enqueuer if the caller is different?

How to use ‘Address Message.vi’ ?

 

Actors.JPG

 

 

                          

 

Thank you for help.

-
Amit
CLAD
0 Kudos
Message 1 of 4
(4,510 Views)

The best place for AF discussions is the AF group, where things like this are discussed often. See for example this current discussion on the topic - https://decibel.ni.com/content/message/126165#126165

 

The basic answer is that you can either pass all the messages through the caller (your green arrows) or that the caller can send B's enqueuer to A and A will store B's enqueuer in its data so it can send messages to it. The best approach is a topic of debate, as you can see in the discussion above and in others.

 

For the second approach, if your caller is different and the caller is responsible to sending the enqueuer, then the new caller will also need to send the enqueuer.

 

The address message VI is supposed to be used when you want to an actor A to send a specific message to *some actor B* without A knowing any details about the message or about actor B. You use that VI to tell actor A about both B and the message.


___________________
Try to take over the world!
Message 2 of 4
(4,490 Views)

Hi Tst,

 

Thank you for your response.

 

Sorry to put AF question here, I was putting there but it was taking time to approve.

 

Approach 1: Lengthy (same I have used in my previous post's attachement)


 

The basic answer is that you can either pass all the messages through the caller (your green arrows)


 

This will be more complicated because the application I am developing is much more complex than above and code will become much lengthier.

 

Approach 2: Simple approch example attached


 

the caller can send B's enqueuer to A and A will store B's enqueuer in its data so it can send messages to it. The best approach is a topic of debate, as you can see in the discussion above and in others.

 

For the second approach, if your caller is different and the caller is responsible to sending the enqueuer, then the new caller will also need to send the enqueuer.

 


 

 

This I tried , as I am  launching both A and B actors from same caller(main), I send message(B’s enqueuer) from  Main actor to A actor and store this B’s enqueuer inside the while loop and use it to send message to B actor.

 

I like this approch simple to use but I might be missing pros and cons as warn here.

 

 

 

 Approach 3 (Question)


 

The address message VI is supposed to be used when you want to an actor A to send a specific message to *some actor B* without A knowing any details about the message or about actor B. You use that VI to tell actor A about both B and the message.

 


 

I am bit curious about this approach, can you explain it more please about,

1.Where to use this ?

With my poor OO and AF knowledge, my guess is inside actor A but then

2.Do I still need to get the B’s enqueuer in A as address message.VI still needs destination’s (B’s) enqueuer  ?

 

Thank you for help.

-
Amit
CLAD
0 Kudos
Message 3 of 4
(4,444 Views)

I suggest you keep the conversation there and read the many discussions there.

 

Just to make one point clear:

 


amitwadje wrote:

 

 Approach 3 (Question)

...

I am bit curious about this approach, can you explain it more please about,

1.Where to use this ?


I wasn't suggesting that you use this. I was only replying to your question about what that VI does. I don't have a particular use case in mind for that VI, and you probably don't want that anyway, because A doesn't know anything about the message, so it can't put any information in the message. It can only send it.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(4,400 Views)