04-21-2025 03:24 PM - edited 04-21-2025 04:11 PM
The situation:
Two questions:
__PRESENT
Solved! Go to Solution.
04-21-2025 03:42 PM
Like in the other thread about moving things, there is a Locked property node:
The way to get this visible is nearly the same as in the other thread:
You can make this (and a LOT of other stuff, most of which you won't need) visible by changing your LabVIEW.ini file to include this line:
SuperSecretPrivateSpecialStuff=True
Alternately, to add it without changing your INI file:
1. Drop an invoke node for the Library (or LVClassLibrary) class on one of the other properties (any).
2. Make sure it and nothing else is selected on the block diagram.
3. Press control-space to bring up Quick Drop
4. Wait for a bit if this is the first time you have opened it
5. Type in "Locked"
6. Press Control-Shift-B
It should then alter that invoke node to be a "Locked" property.
However, the functionality of this looks a bit weird, as it's an I32, not a Boolean. It's also writable. I advise you to only read from it, as writing to private nodes like this could cause problems.
The other thing I would mention is that sometimes to make things usable you need to make sure that you're opening it using the correct Application instance. If you get locked libraries, I would try making sure that you're passing a "This application" reference around to make sure it is always trying to open it under the same reference.
04-21-2025 04:09 PM
Hi,
@10Things_Rob wrote:2. It feels like LabVIEW often locks libraries for no reason. For example, there's only one project open but the library is locked. I open the library, which unlocks it, then close the library and it remains unlocked. Who knows why and/or tips to avoid this locking behavior?
A class will be locked as soon as it is loaded in more than one context ( = application instance).
In a project, a class is already loaded in the application of its owner target (typically "My Computer"). If you then open a refnum to the class programmatically from one of your tools (from the Tools menu, from a Project Provider, ...) without wiring the application refnum input, it will use the tool context and then lock the class.
So you have to find the owning target of the class first, and use its associated application to open the class refnum. Class ProjectItem has a subclass "TargetItem", which has property "Application". It is a refnum to the context of the target.
Regards,
Raphaël.
04-22-2025 03:21 PM
I accept and appreciate what you're saying.
What I am seeing is:
1) Launch LabVIEW
2) Open Project (which only has one target)
3) Class in project is locked.
4) Open Class
5) Class is unlocked
6) Close Class
7) Class remains unlocked
This is all manual operations, nothing at all to do with scripting
__PRESENT
04-22-2025 03:32 PM
Turns out, there is ALSO a Boolean, which does not allow write-access.
It seems from experimentation that they indicate the same value.
Also, from experimentation, opening the reference to the Project does not unlock it; only doing that manually from the project window unlocks it. Must be something happens as part of the process of opening the window that causes it to re-evaluate whether it should be locked.
__PRESENT