Table Of Contents

Messages in the Actor Framework

Last Modified: February 27, 2020

Use Message objects to modify the state of an Actor object. Message objects take the place of individual cases in a traditional queue-driven state machine.

Each Message in the Actor Framework is a class that inherits from the Message parent class. Part of the Message parent class is a method called Do. The Do VI represents the action the Message performs. Every Message must override the Do VI. Child Message classes usually include some attribute data and a Send Message method where Message is the name of the Message to send. Depending on the application, Messages may also include methods for reading or writing the Message data.

The queues that the Launch Root Actor VI receives and returns accept specific Message types as their data type. For a VI to interact with an Actor, it must have access to the send queue for that Actor so the VI can create a Message of the correct type and post it to the queue. To do this, the VI invokes the relevant Send Message VI. The Send Message VI combines creating the Message, writing Message data, and posting it to the queue in a single call.

You must provide a Message for every method of your Actor that you want to access remotely. A Message typically represents a call to one method of the class, and the private data of the class makes up the input parameters needed to invoke that method. When your Actor receives a Message, it invokes the Do method for that Message. The Do VI in turn invokes the appropriate operation on the Actor. You can use Messages you create for a specific Actor class with any child of that Actor.

Recently Viewed Topics