LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Invoke Method : Run VI

I am not sure if it is possible or not. I am trying to use the Run VI , invoke method to achieve the folllowing.

 

1. I do not want the user to click on RUN  icon to start the execution, hence I have hidden this icon from the VI  properties.

 

2. Is it possible (it is only in my imagination), to only let the user say click on a button I provide, to start the execution of the VI

0 Kudos
Message 1 of 6
(5,722 Views)

 


@ade77 wrote:

I am not sure if it is possible or not. I am trying to use the Run VI , invoke method to achieve the folllowing.

 

1. I do not want the user to click on RUN  icon to start the execution, hence I have hidden this icon from the VI  properties.

 

2. Is it possible (it is only in my imagination), to only let the user say click on a button I provide, to start the execution of the VI


 

The VI would have to be running to execute the Run VI invoke node so that is a non-starter.  It is an interesting, yet ultimately pointless endeavor to do the hacking required for #2 as you have described it.

 

It is extremely simple to set the VI to Run when opened (VI Properties -> Execution), and then sit around and do nothing until the user presses the button you provide.  This is one case where I use an Event structure without a while loop.

Message 2 of 6
(5,716 Views)

@Darin.K wrote:

 

 

It is extremely simple to set the VI to Run when opened (VI Properties -> Execution), and then sit around and do nothing until the user presses the button you provide.  This is one case where I use an Event structure without a while loop.


Now that is a great idea.  I usually spin around in a while loop until the user presses a button.  Thanx for the great tip Darrin.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 6
(5,701 Views)

Hi,

But I think the VI will run only once when the user clicks the button without the while loop.

I also tried to do the same but there if the user clicks the stop button then he has to click the run(provided by LV) button on the FP to execute the VI.

If he clicks user made run button, then that VI will not execute.

 

 

 

 

Regards,

Runjhun A.

0 Kudos
Message 4 of 6
(5,330 Views)

You end up with two seperate vis:

 

VI1 has the event structure and the button on the front panel. When you press the button it launches VI2 and then closes itself.

VI2 has all the code you want to run when the button (from VI1) is pressed. When the user stops VI2 (or when the program determines that its execution is complete), it relaunches VI1 and then closes itself.

0 Kudos
Message 5 of 6
(5,314 Views)

@ade77 wrote:

I am not sure if it is possible or not. I am trying to use the Run VI , invoke method to achieve the folllowing.

 

1. I do not want the user to click on RUN  icon to start the execution, hence I have hidden this icon from the VI  properties.

 

2. Is it possible (it is only in my imagination), to only let the user say click on a button I provide, to start the execution of the VI


Certainly this CAN BE DONE. see here for a famous example.  But READ the thread- this is a silly idea and is not the approach you want to take.  Your basic structure is questionalbe at best since it implies a very tight coupling between the GUI (user input) and the Program function.  better practice is to use an event loop to respond to user input and pass commands to the "Guts of the process" to control some form of a state machine that does the heavy lifting.

 

as an example look at the producer consumer (Events) template.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(5,310 Views)