From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Do.vi if input is LV Object

Solved!
Go to solution

HI!

First I created a class MyActor and then I created a method (Handle Data.vi) with two inputs: string and LV Object. I used a shortcut menu for this method (Actor Framework > Create Message) to create a message class with methods "Send Handle Data.vi" and "Do.vi". In "Do.vi" pins are not wired correctly. "To More Specific Class" output is connected to the LV object element of the cluster instead of "MyActor In" pin of the called method (see picture).

SH_005.jpg

It seems the script for creating Do method is not perfect. I believe it will soon be updated. Till then it's not difficult to make small correction in Do.vi method and connect pins manually.

A project is appended in zip file.

Regards,

Ljubo.

0 Kudos
Message 1 of 5
(6,190 Views)
Solution
Accepted by topic author Ljubo

Confirmed the bug. I filed CAR 647761 to get this fixed. Too late for LV 2017 (releases next week, so it is done).

0 Kudos
Message 2 of 5
(6,158 Views)

Turns out the problem can occur if the message payload contains any ancestor of the actor class. Luckily, it is rare that you send an actor object as a message to another actor, so few people have hit this. I've included this update in the CAR.

0 Kudos
Message 3 of 5
(6,156 Views)

Thank you for the answer.
In fact I never send an actor object as a message to another object. I'm sending measured data from different devices (analog input, digital input, GPS device) to an actor which processes different types of data: analog waveforms, digital waveforms, huge strings, .... The idea is to pack different types of data to objects and send this objects to data handler. The first input in "Handle data.vi" is a string (you can call it instruction or command) which tells the handler how to type cast the second input (LV Object) to a more specific class. This method reduces the number of messages but I have to define a class for each type of data.
I'm using the same method when it is necessary to handle many user menu events. The first input (string) is menu item tag, the second (LV Object) can be empty (not wired) or can contain control reference, old value and new value, cursor position, .... All user menu events are handled with the same message handler (and one case structure in it). More than that: if there is an actor which is a descendant of Actor.lvclass and is an ancestor of all other actors I can create a dynamic method "Handle Data.vi" and a message class "Handle Data Msg" only once and it can be used by all other actors in the class hierarchy.

With best regards, 

Ljubo.

0 Kudos
Message 4 of 5
(6,145 Views)

This CAR will be fixed in LV 2017 SP1.

Message 5 of 5
(5,790 Views)