07-25-2015 11:01 PM
Hi.
I want to use dynamic dispatch OOP-methods to write to Xcontrols on the front panel of the main VI. In the image below, I have illustrated a very simple example, using static methods.
However, as soon as I introduce a strict reference to the Xcontrol anywhere into the class, the Xcontrol becomes locked, even when all VI's of the project are closed. I know, I can unlock the Xcontrol, edit it and lock it again.
However, in my real project, I have an additional Singleton that is used both in main as well as in one of the Xcontrols. This class then becomes completely locked meaning that there is no possibility any more to edit it from within the project or do a search for callers. The latter is quite annoying as this makes any search for callers impossible, as the search is done on VI's in memory.
Is there a reason for this locking, when nothing but the project is open, is there some alternative solution?
Herbert
Solved! Go to Solution.
07-26-2015 04:26 AM
@Herbert wrote:
Is there a reason for this locking, when nothing but the project is open, is there some alternative solution?
I don't have experience with this, so I'm not aware of a solution, but you can search to find other people asking about this, as it has come up before. Basically, classes load all their VIs when they load (which happens when you open the project). When a VI calling an XCtrl is loaded, it locks the XCtrl. Combine the two and there's your reason.
07-26-2015 07:45 AM
Thank's tst,
I really was not aware that all classes, and maybe also lvlib's, load into memory on opening the project. This makes everything clear and I have to get a better solution to my use of a singleton in the Xcontrol.
This is probably better anyway, as the Xcontrol becomes more independent of the rest of the code.
Herbert
07-26-2015 08:27 AM
@Herbert wrote:
I really was not aware that all classes, and maybe also lvlib's,
lvlib no, lvclass yes and I think also xctl and xnode, although I'm not sure about those.