06-06-2018 02:21 PM
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):
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
06-07-2018 01:00 PM
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
06-07-2018 01:11 PM
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
06-08-2018 01:15 AM
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