LabVIEW AF_6 Actor System Design and Messaging

First rule of coding - Just write the code.

Tom McQuillan Youtue Channel, LabVIEW Sample Code

Chat Window_Actor System Design and Messaging

Actor Orientated Design

Actor Orientated Design (AOD), Root Actor (Calling Actor) and Nested Actors

Communication is created by saving Enqueuer to Actor Class Private Data.

  • Self-TO-Caller Enqueuer
  • Send-TO-Self Enqueuer

When a “Caller Actor” call “Nest Actor”:

  • Launch Actor.vi
  • Pass “Caller Message Queue” (Root Actor for example) to nested Actor
  • Get Caller Actor’s Message Queue Reference Queue
  • Exchange Message Queue Class to setup two-way communication

To be clear that, message tree is Different with Inheritance class. There is not Parent and Child relationship, they all incidence of original actor (Actor.lvclass)

Message is exchanging via Message Queue. Every actor can only access two message queue :

  • Self Message Queue (Callee Message Queue)
  • Caller Message Queue

As shown below:

  • The callee Actor Y can access self message queue via route 4, and access caller Actor X via route 3

  • The main caller x can access self message queue via route 1, and access caller Actor Y via route 2

Summarize the communication rule for Root Actor and Alpha, Beta Actor

  1. Root Actor can send message to Alpha, Beta and itself
  2. Alpha Actor can only send message to Root and itself
  3. Beta Actor can only send message to Root and itself
  4. Alpha and beta can not send message to each other

Develop

The ‘Model’ will be the ‘Brains’ of the Chat Room Windows. The ‘Controller’ is the user interface. I.e. what the user ‘Controls’

The output of launch nested actor is Nested Actor’s Enqueuer. It returns the reference to the enqueuer. Use this reference to send messages to the newly launched actor. It is the child of Message Enqueuer.lvclass

Structure of the application

Message route

Comments