Zyah Solutions

View Original

The AF Msg Forwarding Utility: Getting Started

Getting started with the Zyah AF Msg Forwarding Utility is simple, but it does require some initial architecture decisions and setup.

Once you’ve installed the VI package, all the pieces you need to begin integrating the utility with your application are immediately available.

This guide will take you through our recommendations on how to integrate the Msg forwarding utility into a new, blank Actor Framework project. (If you have an existing AF project, the steps to integrate the Zyah AF Msg Forwarding Utility are very similar and just as easy.)

When finished, you will have an actor project that generates messages from a Fridge Actor for consumption by a Chart Temperature Display Actor.


Note: The images referenced here are from LabVIEW 2020 SP1 and the code uses v1.1.0.2 of the Zyah AF Msg Forwarding Utility.


Add Zyah AF Msg Forwarding Utility to Project

Start by creating a new empty project. Save the project before continuing. In this example, we can save it as “Getting Started AF Msg Forwarding”

Once the new project is created, open a new blank VI. On the block diagram, navigate to the Zyah Solutions > Zyah AF Msg Forwarding palette and place AF Msg Forwarding Actor.vi onto the block diagram. This is done as a quick way to load the forwarding utility into the project dependencies.

Move the AF Msg Forwarding Actor library directly into the project (out of “Dependencies”).

Base Actor

Now that we have the forwarding utility and the forwarding base actor in the project, we can create our project-specific base actor. The purpose of the base actor is to provide a single point of inheritance so that all actors in the tree have access to the forwarding utility. This base actor will also need to inherit from the AF Msg Forwarding Actor.

Create a new Actor in your project. This can be done by right-clicking on My Computer and selecting New > Actor.

Data Interface Class

Before we create our data generator actor, we need an interface with messages to send our generated data.

Update Base Actor List of Interfaces to Forward

Data Generator Actor

We need a data generator that will continuously send out announcements at N frequency. We’ll use a fridge as an example. The fridge will send out its fridge temperature at a rate of 1Hz. The fridge actor will also need to inherit from our Base Actor so it has access to the utility.

Create a new actor and name it Fridge Actor.

Data Consumer Actor

Now that we have an actor generating data, we need an actor to consume and display this data. Create a new actor called Chart Temperature Display Actor.

Root Actor

The Root Actor will provide us with a starting point for this demo. Root Actor will launch both the Fridge Actor and Chart Temperature Display Actor. It is also responsible for forwarding messages in the application using the Zyah AF Msg Forwarding Utility.

Override Actor Core VI and launch both the Fridge Actor and Chart Temperature Display Actor using the Launch Nested App Actor VI from the Zyah AF Msg Forwarding palette. Note that this is not the standard Launch Nested Actor method that ships with Actor Framework. Launch Nested App Actor is needed for automatic announcement forwarding to take place.

Make sure you set Open Actor Core front panel? to True for the chart actor.

Run the Launch AF Forwarding Demo. You should see the Chart Temperature Display Actor front panel updating at 1Hz with random data.

Remember, temperature data is automatically being forwarded through our base actor. Root Actor does not need to inherit from the announcements interface or provide its own interface override. The forwarding utility handles forwarding data from the fridge actor to the chart display.

Have fun with this and let us know what cool projects you’re able to build using the Zyah AF Msg Forwarding Utility.