Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Broken VI When Creating a Concrete Implementation of an Abstract Message with Variant Input

I think I found an error in Actor Framework. I created an abstract message that uses a single variant as it's data type. When creating a concrete implementation of this message the Do.vi is broken.

 

I used Create Child of Abstract Message from the right-click menu in the project.

 

The final VI looks like this (It's also in the Step 2 project):

Capture.PNG

It's an easy fix, and this doesn't occur when creating a normal message, only when creating a child of an abstract message

Regards,
Dan King

0 Kudos
Message 1 of 4
(2,785 Views)

Hi Dan,

 

I remember dimly having seen a behavior like this back in LabVIEW2013. I think I have worked around this NOT using variant data....

But it' been  a while...

 

If I may ask: what is your use case for having a variant message parameter?

 

BR

Oli

0 Kudos
Message 2 of 4
(2,755 Views)

I am using a nested actor off of the root to provide a data distribution service based on pub/sub throughout my application. Each topic can be a different data type and I didn't want to create a bunch of abstract messages. I just convert to and from the topic data type in the concrete implementations.

Regards,
Dan King

0 Kudos
Message 3 of 4
(2,751 Views)

Dan,

 

I'd recommend a different approach:

 

Define an abstract message class (dierctly inheriting from AF message). No properties, only one method: override of "Send Message" for this class and it's successors.

Based on this abstract class, define a decent hierarchy for (less abstract) messages and their successors.

The trick is is to contain the data needed in the properties of the concrete message classes.

This might seem a bit more complicated at first, but I think it's a much cleaner approach, that saves you manual casting of variant data to concrete data type (which can cause a lot of trouble without proper error handling)

 

A good presentation to look at is also Casey Lamers' presentation at NIWeek 2018

 

0 Kudos
Message 4 of 4
(2,743 Views)