LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to run vi programmatically

Hi everybody,

 

how can i run the vi programmatically? i cannot find this "run" function in select class>VI server>vi...

 

well, i want to use this function in web publishing tool. so i can make the toolbar (run, abort, & vi logo) invisible and run and stop program in my own vi.

 

thanks for sharing your knowledge...

Ivel R. | CLAD
0 Kudos
Message 1 of 10
(9,827 Views)

It's a method (Invoke Node).

 

Message 2 of 10
(9,820 Views)

hi dennis,

 

thanks for the help.. but it seems i still cannot figure out how to use it. well, its the first time i will used this function. the error below shows everytime i push the "run" button in menubar. but i cannot make the vi running just by triggering the button i made in the front panel. kindly need your help to figure out this problem of mine.

 

error1.jpg

 

thanks

Ivel R. | CLAD
0 Kudos
Message 3 of 10
(9,807 Views)

That makes no sense. You would use the method to run another VI - not the VI where you've placed it (and which is already running). To run a different VI, you need to pass a reference to that other VI by using the Open VI Reference function.

0 Kudos
Message 4 of 10
(9,801 Views)

Here's a video about VI Server References from an NI R&D engineer.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 5 of 10
(9,773 Views)

ivel,

 

The way you are approaching your application will never work.  You can't write code in a VI to start that VI running as the code that you right will never be executed.  As such a VI can not start itself when a user clicks on a front panel control like a button.

 

Is it possible that you could have your VI running all the time and clicking the button moves execution from an idle state into an execution state?

 

Regards,

 

Simon

Message 6 of 10
(9,747 Views)

hi simon,

 

now i see. thanks for clarifying. my program is quite huge, how can i make an idle state & execution state? thru combination of case structures & while loops? btw, i'm still a beginner in LV programming so i ask you guys for more patience. sometimes i cannot figure out things easily especially when i encountered it in the first time.

 

thanks,!

Ivel R. | CLAD
0 Kudos
Message 7 of 10
(9,708 Views)

to dennis,

 

thanks for explaining the "run VI" function in invoke node. i now figure out but not yet apply its function. Smiley Very Happy

 

to jcarmody,

 

thanks for the very useful links!.. i'll go thru that after...

Ivel R. | CLAD
0 Kudos
Message 8 of 10
(9,707 Views)

 


@ivel wrote:

hi simon,

 

now i see. thanks for clarifying. my program is quite huge, how can i make an idle state & execution state? thru combination of case structures & while loops? btw, i'm still a beginner in LV programming so i ask you guys for more patience. sometimes i cannot figure out things easily especially when i encountered it in the first time.

 

thanks,!


If your progam is "quite huge" and you are asking about how to make an idle and execution state, this tells me that you are not using a good design architecture. I would recommend that you read up on application design patterns, especially the state machine. Note that the design patterns are distributed as templates with LabVIEW, and can be accessed/created via the File -> New... menu item.

 

0 Kudos
Message 9 of 10
(9,689 Views)

Your using "TB.Visible" what you should be using is "FP.Open".  

 

This like has some example code for what you want to do.

https://decibel.ni.com/content/docs/DOC-3413

0 Kudos
Message 10 of 10
(8,626 Views)