Actor Framework Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Abstract Message Example

This example shows one way to use abstract messages to implement low coupling communication between actors.  The code is written in LV 2013.

Comments
reteP
Member
Member
on

Anybody has it in old version ??? LabVIEW 2012

Thank You.

dsavir
Active Participant
Active Participant
on

Hi, You can download it from from here. Good luck!

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
dsavir
Active Participant
Active Participant
on

Hi,

Is there some documentation available? I don't understand how process 1 knows to call the Do of the child of Get Current Time Msg and not of the parent.

Thanks for uploading!

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
reteP
Member
Member
on

Thank you 😉

AristosQueue (NI)
NI Employee (retired)
on

dsavir wrote:


                       

Is there some documentation available? I don't understand how process 1 knows to call the Do of the child of Get Current Time Msg and not of the parent.

Thanks for uploading!


                   

Works the same as any other dynamic dispatch call -- LabVIEW invokes the method for whatever object is on the wire at run time. If the object on the wire is Get Current Time Msg then that's the method that will be invoked. If the object on the wire is the parent class then the parent class' version will be invoked. Nothing magical here.

dsavir
Active Participant
Active Participant
on

But the process that sends the message sends the abstract parent message, doesn't it? it's the process that accepts the message that knows about the child at all. Otherwise, how is this abstract? I think I missed a step somewhere

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
AristosQueue (NI)
NI Employee (retired)
on

dsavir wrote:


                       

But the process that sends the message sends the abstract parent message, doesn't it? it's the process that accepts the message that knows about the child at all. Otherwise, how is this abstract? I think I missed a step somewhere


                   

No. The process that sends the message sends the concrete message, even though all it knows about is the abstract parent. Here's the details:

You have Sender and Receiver.

Receiver has to tell Sender "send me this concrete message". If Receiver is also Caller, then it may put its concrete into Sender when launching Sender. Otherwise, Receiver may send a message to Sender telling Sender, "Here is the messsage I want you to send." Receiver stores the message in its private data IN A FIELD OF TYPE ABSTRACT PARENT. Then when Sender is ready to send the message, it uses the version in its private data. So the only TYPE that the Sender is ever working with is abstract parent, but the OBJECT on the wire at run time is the concrete child.

dsavir
Active Participant
Active Participant
on

OK, now I got it Thanks AQ!

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Contributors