LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program vi as subvi

Hi all, i have a program vi (A)  that i compile to run as exe, it has a chart, event structure ,variabile ec.... Now im developing another Application (B)  and i want integrate A in B. I would like to integrate the app and interact with it to get a chart value, variabile value and send the event. What is the best method to do this?  

0 Kudos
Message 1 of 7
(1,852 Views)

Hi loopin,

 


@Loopin3 wrote:
I would like to integrate the app and interact with it to get a chart value, variabile value and send the event. What is the best method to do this?  

Use VI A as subVI of VI B...

Best regards,
GerdW


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

this is what I do with simple vi's which don't have while loops and which I can run synchronously. In this case the VI A has while loops and more and I would like to run it asynchronously and interact with it.

0 Kudos
Message 3 of 7
(1,832 Views)

Hi loopin,

 

you still can use it as subVI...

Interact using usual functions like queues!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(1,827 Views)

@Loopin3 wrote:

Hi all, i have a program vi (A)  that i compile to run as exe, it has a chart, event structure ,variabile ec.... Now im developing another Application (B)  and i want integrate A in B. I would like to integrate the app and interact with it to get a chart value, variabile value and send the event. What is the best method to do this?  


Where does program A get it's inputs? If it has an event structure, I assume it has controls that are operated by the user. Especially since you built it in an executable, it looks like a toplevel program.

 

There are many very vague statements.

What is "Integrate"? For example do you want to call VI A from B to run independently? Do you want to call the exe built from A? Do you want A in a sub-panel of B?

What is a "variable"? (just a control or indicator? Local variable? Global variable? Shared variable?)

 

If the user interacts with the front panel of A and VI B interacts with it too at the same time, who should "win"?

 

I think it would be better if you take a step back and tell us "what" you want to do, not "how" you want to do it. How should it behave from a user perspective? Maybe there are much better ways to do whatever you are trying to do.

 

At least explain what the programs do, maybe even attach some simplified code.

0 Kudos
Message 5 of 7
(1,823 Views)

@altenbach  ha scritto:

@Loopin3 wrote:

Hi all, i have a program vi (A)  that i compile to run as exe, it has a chart, event structure ,variabile ec.... Now im developing another Application (B)  and i want integrate A in B. I would like to integrate the app and interact with it to get a chart value, variabile value and send the event. What is the best method to do this?  


Where does program A get it's inputs? If it has an event structure, I assume it has controls that are operated by the user. Especially since you built it in an executable, it looks like a toplevel program.

 

There are many very vague statements.

What is "Integrate"? For example do you want to call VI A from B to run independently? Do you want to call the exe built from A? Do you want A in a sub-panel of B?

What is a "variable"? (just a control or indicator? Local variable? Global variable? Shared variable?)

 

If the user interacts with the front panel of A and VI B interacts with it too at the same time, who should "win"?

 

I think it would be better if you take a step back and tell us "what" you want to do, not "how" you want to do it. How should it behave from a user perspective? Maybe there are much better ways to do whatever you are trying to do.

 

At least explain what the programs do, maybe even attach some simplified code.


the application A is a toplevel application, the user can interact with it. I want use it and show the panel in other top level application, get the value of local variable,  send a signal to stop, get a chart value. 

 

Using the subpanels i can reuse application and run it independently but i dont know how i can send a signal to stop it, get a value of  local variable...

 

0 Kudos
Message 6 of 7
(1,786 Views)

Hi Loopin,

 


@Loopin3 wrote:


the application A is a toplevel application, the user can interact with it. I want use it and show the panel in other top level application, get the value of local variable,  send a signal to stop, get a chart value. 

 

Using the subpanels i can reuse application and run it independently but i dont know how i can send a signal to stop it, get a value of  local variable...


A local variable is local to a VI, you cannot read it from another VI. Did you take the basic LabVIEW training?

You need to implement some communication between your VIs A and B, like using queues…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(1,783 Views)