LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call subVI as independent window

 

VI A is my primary user interface. At the click of a button, it may open a separate window, VI B, which may remain open for an extended period of time and operate independently of A. Now, my question is, what is the best practice for how to call B, without hanging the user interface of A? The software will be built into an app, so I can't use anything involving VI Server.

Just to be clear – I'm not asking how to COMMUNICATE information between the two VI's, but simply how to CALL B in the most straightforward manner. B might get some friends in the future, and I'd rather not create a parallel loop for each if there's a better way.

0 Kudos
Message 1 of 8
(2,992 Views)

Hi Joymaker,

 

Now, my question is, what is the best practice for how to call B, without hanging the user interface of A?

Use either VIServer or the ASync call functions…

(Or place that subVI in a parallel running loop.)

 

The software will be built into an app, so I can't use anything involving VI Server.

Why do you think so?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,980 Views)

Most of VI Server will work just fine in executables. This part certainly does.

 

As an unorthodox answer to your question: Put the VI in parallel to your code. It will always run when the main is running (and stop when the main is stopped). Then, show or hide the front panel (with VI Server, it's unavoidable) when needed.

 

That follows all your requirements:

+ it may open a separate window, VI B,

+ which may remain open for an extended period of time and

+ operate independently of A.

But not (which is silly anyway):

- use anything involving VI Server.

 

There's no practical way to do this without VI Server.

 

Unpractical:

Call "LabVIEW.exe <path to subVI>" or "MyLV.exe <path to subVI>" from the command line, and set the VI to run when opened... That would start it without VI Server.

0 Kudos
Message 3 of 8
(2,930 Views)

I have read in several contexts that VI server material can't be built into an app.  Am I wrong?

0 Kudos
Message 4 of 8
(2,911 Views)

All my executables would be dead if I couldn't use VI Server.  I think we are misunderstanding you.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(2,903 Views)

You may want to take a look at this VERY OLD buried Nugget I shared some years ago.

 

It has some extra features that let you dock the pop-up or find it in a pile of pop-up screens.

 

Ben

 

 

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

I've had my issues with vi server in an exe. Usually 3rd-party driver vis where the vi "loses" subvis and various linkages. I find the subvis and include them in the build but they still don't link.

 

I've had much better luck using static vi reference. 

 

static vi reference snip.png

PaulG.
Retired
0 Kudos
Message 7 of 8
(2,885 Views)

@Joymaker wrote:

I have read in several contexts that VI server material can't be built into an app.  Am I wrong?


Yes, you are wrong. We'd need those contexts if you want to know where your reasonings or those references are wrong...

 

Scripting is (AFAIC\IMHO) a subset of VI Server. Most of that isn't allowed in builds. The documentation on this is pretty good. The help will mention if a property or method is allowed in the run time engine.

 

What you want to do here is definitely allowed.

 

None of my applications would work without VI Server either.

0 Kudos
Message 8 of 8
(2,853 Views)