LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI reference and scripting - Unlock method

Solved!
Go to solution

HI LV experts out there :),

 

I run into a problem i couldn't understand recently..

My task is to make some UI changes to a large amount of VI's (more than 300..)

So i was trying some LV scripting to help me.

many of the objects in the FP's i want to modify are locked,

After some googling I found the pane -> unlock objects method 

I wrote a small script and a test case with some locked objects.

What I couldn't understand was - 

When I obtained the reference to the target VI with "Static VI reference" it worked fine

But when I used the "open VI reference" with a path input - nothing happens and no errors are returned.

Attached are the example VI's

 

Can anyone explain how can i make the unlock objects method work using a reference obtained with the "open VI reference"?

 

P.S. I am using LV 2016

 

Thanks,

Barukh

 

Download All
0 Kudos
Message 1 of 5
(2,811 Views)

Hi Barukh,

 

Are you still having issues with this? I downloaded your VIs, and the scripting seemed to work on my end. The only change I made was the file path reference to match where I saved your VIs. I ran both Unlock Objects and Lock Objects with both Open VI Reference and Static VI Reference and saw the same behavior in each case. Is it possible that your file path was to a different VI?

Madison T
0 Kudos
Message 2 of 5
(2,748 Views)

Hi Madison,

 

For other reasons it seems that it would be unavoidable to go over each VI manually.

After your answer I retested the VI's on my end, on different paths on my PC and the problem seem to persist.

I Forgot to mention it on my previous post, but the problem occurs when I run Unlock Objects and unlock test is closed. If unlock test is open in edit mode the unlock method works fine.

 

Barukh

0 Kudos
Message 3 of 5
(2,735 Views)
Solution
Accepted by topic author Barukh_t

Hi Barukh,

 

Thank you for the clarification. I was able to reproduce the issue when unlock text.vi was closed. I was able to fix this by adding a Save.Instrument method at the end of Unlock objects.vi. I believe when you dynamically call the VI and it is not in the current application instance, you need to explicitly save the VI in order to see any changes the next time you open it. Let us know if that worked.

Madison T
Message 4 of 5
(2,719 Views)

Yes adding save.instrument method works fine. It makes much more sense now.

 

Thank you very much for your help and explanation.

 

Barukh 

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