07-19-2018 06:30 PM
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.
Solved! Go to Solution.
07-20-2018 03:57 AM
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".
07-20-2018 05:41 AM
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
07-20-2018 06:11 AM
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?
07-20-2018 10:38 AM
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
07-21-2018 06:20 AM
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.
07-23-2018 09:45 AM - edited 07-23-2018 09:45 AM
Thank you crossrulz
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