LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControls and the Actor Framework

For my latest project I decided to use the actor framework that ships with LabVIEW 2012.  My top level actor serves as my UI.  When the user updates the front panel I capture this in an event structure and send off the appropriate messages and update my front panel accordingly.  When other actors respond with messages to this top level actor I update my front panel from the actor core using references to my controls/indicators that I passed in to the actors private data.  All was well and good except now I need to control some xcontrols and I have found that it is not possible to have a reference to an xcontrol in the private data of a class.  Has anyone else ran into this problem and do you have a possible solution?

 

Note:  I had these xcontrols from the beginning and used an add on to the JKI right click framework to create the references and type def to pass them into my actor.  Everything seemed fine and dandy until I modified a different control in the type def and LabVIEW started giving me this error, the fact that it didn't give me an error earlier sounds like a bug to me...

Message 1 of 5
(2,605 Views)

Greetings;

 

I am curious about something; when you say that everything seemed fine until a control in the typedef was modified, do you mean that it looked fine or that it was functioning correctly? As in, had you been able to give it a try and see it work before the modification, or that you simply did not get an error but are doubtful it ever actually worked?

 

In addition, what exactly is the error that you are seeing? Is there an error code or some such?

 

Cordially;

 

Simon P.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(2,569 Views)

At this point I'm already in the process of removing all my XControls and replacing them with standard controls, I think I've officially given up on XControls for the time being.  That being said I will satiate your curiosity:

 

I created two xcontrols, one was simply a 'tri-state led' which held the data of an enum with possible states of red, yellow or green that corresponded to the color of the led. The second was an array which had first and last buttons and had a x of y display to show you where you were in the array.  I had one of the second and several of the first on my front panel.

 

In order to create my cluster of references to pass to the actor core I used this JKI Right Click Framework plugin:

 

https://decibel.ni.com/content/docs/DOC-5813

 

I put this type def into my actors private data (this did not cause any sort of error at the time)

 

I wrote several methods which accessed the references to the tri-state LEDs and was able to run the project and test functionality of this code with no problems (i.e. I ran it, the actor accessed the xcontrol references and updated them on my front panel).

 

Later, I changed some of my buttons on my front panel from latching to switching and updated the type def to use strict typed references for these controls (not xcontrols) and then all of my VIs became broken.  I should stress that this was not the first time I had updated the type def, I had previously reordered/renamed items and had applied those changes.

 

I believe the error was "owning library has blocked execution of the vi" or something similar.  After a bit of searching I saw this:

 

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/defin_priv_data_class/

 

with the note:  A private data control cannot contain an XControl or an XControl refnum.

 

and here we are...

Message 3 of 5
(2,562 Views)

@Gollum wrote:

...

 

I wrote several methods which accessed the references to the tri-state LEDs and was able to run the project and test functionality of this code with no problems (i.e. I ran it, the actor accessed the xcontrol references and updated them on my front panel).

 

Later, I changed some of my buttons on my front panel from latching to switching and updated the type def to use strict typed references for these controls (not xcontrols) and then all of my VIs became broken.  I should stress that this was not the first time I had updated the type def, I had previously reordered/renamed items and had applied those changes.

... 

and here we are...


 

..reporting a bug.

 

LV should have flaged the error earlier instead of waitng for a def change to break it.

 

of course my curiosity has me asking if it was not made strict or made strict, apply changes then set back to normal type def.

 

These decisions are clearly above my pay grade.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,555 Views)

As far as I know I kept everything as normal type defs, no strict type defs.  Of course I haven't looked into the inner workings of that right click framework plugin to see how it was initially created.

0 Kudos
Message 5 of 5
(2,533 Views)