LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI invoked from Tools Menu behaves different problem, NI.LV.Dialog

Hi guys,

 

I am creating an utility in LV2018 to launch from the Tools menu, which will be able of centering FP window on the main screen and I encountered a problem. To focus on the problem only lets consider a following simple VI:

FP_move.png

Assuming that I have a sample test2.vi in the temp dir, I can use attached code to modify position of the FP. I can also use invoke node to use fp.center method as well.

 

Problems appears when I want to invoke this functionality from the Tools menu. I put the VI to the C:\Program Files\National Instruments\LabVIEW 2018\project, restarted labview and opened it from the Tools menu. And the behavior is different - even though I am using reference to the file from hardcoded path to the blank VI.

aaa.png

After choosing VI from the tool bar, it opens test.vi which is being opened in NI.LV.Dialog application context (bottom left corner). Then when I run this VI instead of moving test2.vi FP to the upper left corner it creates a new test2.vi Front Panel in NI.LV.Dialog application context. So I have opened 2 separate front panels for the same file - I can see that they have the same file path in the VI settings.

But changes done to the NI.LV.Dialog instance of my VI don't propagate to the proper VI. 

 

I just want to create a simple tool that will move my front panels to the center of primary screen. I haven't found anything that could help me and I am out of ideas.

-Do you have any idea how I can modify position of FP and save it succesfully from tools menu?

0 Kudos
Message 1 of 4
(2,309 Views)

Why the utility, automatic centering not working for you?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,236 Views)

The behavior is expected: Tools run in a different application instance.

In your tool, use this to open a reference to the VI that launched the tool:

lv.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 4
(2,231 Views)

This is not exactly what I need, but gave me a hint I needed.

 

I have some logic, which lists VIs from the active project. So I do not want to center only one VI, but to do it in bulk for many files. Application reference is the key and I found what exactly I need to connect:

 

problem_solved.png

0 Kudos
Message 4 of 4
(2,215 Views)