From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple actors using the same reply message

Solved!
Go to solution

Hi there,

 

I recently started using the actor framework and I am currently using it on a project. This project aims to develop a visual inspection machine for lenses. In the image below you will see the current actor messaging diagram.

Ongelofeloos_0-1674558513637.png

 

I want to reach the following goal:

The Stream actor is used for acquisition of images from the camera. The Measurement Executioner, Snapshot Dialog, and more actors will request images from the Stream. They can do this by sending a 'Grab Image' to the Image Acquisitioner. The Stream actor will then create an image, wait for an event that the camera has acquired a new image and then send it back to the actor which requested the image.

 

What I have now:

I don't know if there is some kind of morphological polymorphic messaging that knows to which actor to send the reply depending on the enqueuer. So I made a work around, currently the requesting actor creates the image and sends the image reference to the Image Acquisitioner. Then the requesting actor keeps checking until the image has been updated and goes on one's way.

 

Is there a better solution to this?

 

0 Kudos
Message 1 of 12
(3,098 Views)

Why not just include the requesting Actor's Enqueuer in the original request (alone with the image reference)?  Then your Stream Actor can send a reply message to this Enqueuer.

0 Kudos
Message 2 of 12
(3,078 Views)

@drjdpowell wrote:

Why not just include the requesting Actor's Enqueuer in the original request (alone with the image reference)?  Then your Stream Actor can send a reply message to this Enqueuer.


Because each Actor Class will have their own reply message method which is not shared/polymorphic between the classes.

0 Kudos
Message 3 of 12
(3,075 Views)
Solution
Accepted by topic author Ongelofeloos

Then attach the reply message as well as the Enqueuer.  Stream Actor sends that reply message to the reply Enqueuer when the image is ready.

Message 4 of 12
(3,043 Views)

If you use LV2020, an interface for Image Acq. may be a solution. Define in it an abstract VI for sending images and a message for it. Implement this IF in each actor that receives an image. Add the enq. of receiver when it requests images from the Image Acq. actor and reply with the abstract message to the enqueer.

 

If you use older LV version a zero or low coupling approach may help.

Message 5 of 12
(3,042 Views)

@drjdpowell wrote:

Then attach the reply message as well as the Enqueuer.  Stream Actor sends that reply message to the reply Enqueuer when the image is ready.

 


How did I not think of this.

@p4keal wrote:

If you use LV2020, an interface for Image Acq. may be a solution. Define in it an abstract VI for sending images and a message for it. Implement this IF in each actor that receives an image. Add the enq. of receiver when it requests images from the Image Acq. actor and reply with the abstract message to the enqueer.

 

If you use older LV version a zero or low coupling approach may help.


I still need to make the switch to LV2020 or later, but this sounds like the ideal solution. Would be nice to start experimenting with interfaces without having to hassle with abstract messaging. For now I will accept