LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send data to a specific clone

Solved!
Go to solution

Hi everyone!!

I'm new working with Actor framework library, however, I have been developed a simulation using this one. In the application I have one parent that throw a number n of childs (These childs are created from other vi in shared clone reentrant execution), in parent interface, I collect data generated by each child, up to this point system is functioning very good. Now I have sending a data to specific child but message only is received for last child running. The message is sent through to queue, but how childs are the same vi, I don't have comunicate with a particular clone. How do I do for send a message to specific clone?

I thankful your collaboration about this problem.

Best regards.

0 Kudos
Message 1 of 7
(2,456 Views)

How many queues are you creating?  It seems you need one for each child, but sounds like you are only talking about one queue.

 

PS:  "Children", not "childs".

0 Kudos
Message 2 of 7
(2,419 Views)

I'm not familiar with AF, but in principal i'd have an integer input to the Child you're starting and use it as a named queue. So Child 1 would use Queue1, #2 Queue2 and so on. Alternatively the Child just remembers this number and you include it in your queue message as an adress; Queue Start-7 to start only the seventh Child.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 7
(2,410 Views)

If you are actually using the Actor Framework, that framework creates a queue for sending messages to that specific actor.  So what I am reading is you are not properly storing those message queues.  Can you share your code to show at least how you are initializing the actors?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(2,407 Views)

Good morning:

I am thankful to everyone, for your fast answers. I want clear some points about the application respect your questions. firstly it's true there is only one queue for sending messages from parent to all children (Thank you RavensFan), secondly I need simulate n machines, so n can vary during the simulation, therefore, the queue should be adapted to the number of machines n, or create n queues, I don't know. I have attached a code of the application if someone wants to simulate more machines, it executes the application, change machines number close all vi windows and newly execute the application. You Noting, that when is selected "control" only last machine turn on indicator "hardware state", but I need for each machine that indicator "hardware state" turn on or maybe I can specify a child for turn on "hardware state".

Thank you so much

 

Base code was taken from 

https://forums.ni.com/t5/Labvolution/LabVIEW-Actor-Framework-Basics/ba-p/3476654

0 Kudos
Message 5 of 7
(2,395 Views)
Solution
Accepted by topic author EDB22

Yep.  Your problem is exactly what I already stated.  You are only keeping the message queue for the last child.  In your FOR loop where you are launching all of the children, you need that output tunnel to be Autoindexing.  Yes, then you also need to update your class' private data type to have the child enqueuer be an array.  You use Index Array to get the specific enqueuer that you need to send to the desired child actor.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(2,383 Views)

Thank you  

 

I have followed your indications and I can communicate with any one child. Thank you again and thank you to everyone for your answers.

Best regards

0 Kudos
Message 7 of 7
(2,361 Views)