06-26-2013 05:40 PM
Stealing from someone (perhaps Staab), I have started launching actors like this:
The "descriptor" is a type def, and the "write descriptor" accessor puts elements of the cluster into the actor's private data. To launch, I either call this VI directly ("standalone", which opens Actor Core.vi's FP) or from another Actor Core.vi, or from another actor's method. Here's from a caller's Actor Core.vi (constant for caller's queue was just to compile):
I put the callee actor and all messages, reports, methods, and the launcher in one lvlib. When I make a new actor: the first time I wire up the launcher, the typedef wire is void. And when I open the launch VI, it's input cluster and the wire are void. Force-compile then restart LV tends to fix it. In the past, I had the same issue, but I thought it was due to packaging each actor with VIPM. To workarond that, I made a Descriptor class and sent that into the launcher instead of the typedef. I have not yet tried setting the actor object's data first, then sending the object to a launch VI.
Sometimes, once the broken wires are fixed, I get a full LV crash when the launcher VI is called. Attached is the beginning of a generic UDP actor, for reference.
Any ideas how to make the broken wires go away?
06-28-2013 04:29 PM
In an actor, there is one typedef cluster (of user events). After adding two events to that ctl, running caused LV to crash (two separate times) until force-compiling. The crash does not happen every time the typedef is modified. I remember reading that a class should not have ONLY a TD clust as its private data, but I don't remember seeing that a TD clust can't be one element in the private data.
07-03-2013 10:53 AM
Something else odd happens, sometimes. The main project has:
- a UI actor, including messages and (child) reports from callees
- UI actor launcher
- helper class
- widget.lvlib
- my DAQ actor.lvlib
- barcode reader.lvlib
- UDP actor.lvlib
Each lvlib has:
- one actor (except the barcode reader which has a child class that fakes the open, close and read if the com port is blank)
- messages to the actor
- reports from the actor (meant to be overridden by the caller
- a launcher that can be called directly ("standalone" mode) or by a calling actor
Sometimes, when I launch one of the nested actors in standalone mode, the main UI actor launcher becomes broken (even though I'm not running it), which breaks the actor I'm trying to run. The workaround is to open the nested actor's lvlib in its own project.
When I make changes to actor private data then run the app, LV crashes (like on the other AF thread). Force-compile tends to restore functionality. The other thing that crashes LV, sometimes usually, is when I copy a message class (right-click on the class, Save, Save as...) then edit the new class' icon, then apply the icon. This is all with a recent install of 2012SP1, 12.0.1f3. This is code I can share with NI, if that would be useful.
07-04-2013 04:41 AM
Hi Todd,
I downloaded your project and tried to recreate your actions that lead to the error, however it is not clear to me what to do exactly. Could you make a small video of the process that leads to the broken wires? (here are some options if you don't have screen recorder - I personally tried and liked Jing)
07-04-2013 07:04 PM
I think it has something to do with linkages between bigger pieces like lvlibs. I've been writing this project in one lvproj with one lvlib per actor. It feels like the problem usually happens when creating or copying classes (messages or reports) within a nested actor's lvlib.
I will have to wait until tomorrow to try to get a solid repro.
Thanks for looking at the code. (We have a site-license for snagit, but Jing works for me, too.)