LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending value from caller actor core to nested actor core

Solved!
Go to solution

Hello All,

 

i need help with actor framework, as i'm new in this.

 

I have created one caller actor and one nested actor with all needed methods and messages.

From caller actor core, i can send messages to methods of nested actor, and that work just fine.

Also abstract message is sent back to the caller.

 

But when I want to send value form caller actor core to nested actor core, i don't have idea how to do this.

Instead of 'ms to wait' and 'send'  controls in nested actor core, i'd like to get values from caller.

 

If anyone can give me direction in which way i should think?

 

Thanks.

Download All
0 Kudos
Message 1 of 8
(1,244 Views)

What are you doing with the data in the nested actor? Are these values only used in the actor core? If so just message from the caller actor to the nested actor. If not then perhaps you need to rethink the structure so that you only need the values in the actor core. Retain the values in the actor private data. If you need to display the values in the nested actor then put references to the controls in the nested actor private data and write to those when the message is received.

0 Kudos
Message 2 of 8
(1,187 Views)


But when I want to send value form caller actor core to nested actor core, i don't have idea how to do this.

What do you mean by caller actor core to nested actor core? Do you want to transfer data between actor helper loops? For that you can send a normal message to the nested and from there you can use a queue or a user event to send data to the actor helper loop.

Lucian
CLA
0 Kudos
Message 3 of 8
(1,183 Views)

Hello,

 

Yes, i just sending from actor loop to nested helper loop.

But this is solved with normal messages. thanks.

 

But there is another problem..

When i close caller actor front panel, nested actor is also close, what is ok.

When nested actor receive stop event, it should send private message (close FTDI communication).

But nested actor is closed before that message is sent and process is complete.

I put 'one button dialog' in my close FTDI message, and action is not complete.

Please for advise.

How can i complete message/method, and then to close nested actor.

Nested actor:

nested actor closes to fast.JPG

 

Thanks

0 Kudos
Message 4 of 8
(1,142 Views)
Solution
Accepted by topic author milan87

When caller actor stops it will automatically stop all nested actors (this is already implemented in the framework). You can override Stop Core.vi in the nested actor and close there the FTDI communication. If data is not available in the actor you can send a message from Stop Core.vi to your helper loop to close the FTDI communication and then another message to stop the helper loop. Do not send the stop message for the helper loop from anywhere else!

Lucian
CLA
0 Kudos
Message 5 of 8
(1,138 Views)

Thanks Lucian,

 

this helps, and now work correctly.

I put close message in stop core of nested actor.

stop core.JPG

But as i am totally new in AF, can you please explain me how to override stop core? And what does it mean?

 

Thanks

0 Kudos
Message 6 of 8
(1,133 Views)

@milan87 wrote:

Thanks Lucian,

 

this helps, and now work correctly.

I put close message in stop core of nested actor.

stop core.JPG

But as i am totally new in AF, can you please explain me how to override stop core? And what does it mean?

 

Thanks


When you make a stop core for the nested actor this is an override. If you do not make the stop core vi then the stop core from the parent class (usually actor) will be used.

0 Kudos
Message 7 of 8
(1,113 Views)

Understood. Thanks

0 Kudos
Message 8 of 8
(1,108 Views)