LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a VI which is member of of a project from commandline

Hello all,

 

First, I use LabVIEW 2010 32 bit with Windows 7.

Now my little problem. I want my computer to launch LabVIEW after restarting the computer. Then I want my current LabVIEW- project to be opened and then I want the main VI of this project to be opened.

Currently I do this using a program named "Startup Delayer", this allows me to set a timeout to start various programs. It starts programs in the same way you would do it from the command line.

I configured this Statup Delayer to start the project file with the following commandline:

"C:\program files\NI\LabVIEW.exe" "C:\projects\myProject.lvproj"

Then I open the Main VI with a delay of 90 seconds:

"C:\program files\NI\LabVIEW.exe" "C:\projects\myMainVI.vi"

 

This often works, but sometimes not. If it doesn't work, a second instance of LV is opened (though this is normally not possible) and in this instance the Main VI is loaded. So if I start to program and create new VIs, they are not added to the project, because my Main VI wasn't opened in the context of the LabVIEW project.

 

I suppose it ist a performance issue, so if I increase the delay time to 2 minutes, it is very likely, that everything is fine.

But I think, this is not a very elegant way.

 

So is there a way to open a VI in the context of a project file from the commandline?

 

Thanks in advance for your help,

 

dave

Greets, Dave
0 Kudos
Message 1 of 4
(3,040 Views)

Hello daveTW,

 

I have achieved the same without command line. I don't know if this will help you or not.

Still I will post the code here.

You can make exe of this code and put it in the Start up, so that when you start your computer this exe will run

and will invoke project and vi you want to open. Let me know how you find this vi, also if there is any bug in this vi.

 

RegardsSmiley Happy

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 4
(3,017 Views)

Hello gak

 

thanks for your VI. I will have a look at it tomorrow.

 

greets, Dave

Greets, Dave
0 Kudos
Message 3 of 4
(3,001 Views)

Hi Dave,

Did you find it useful?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 4
(2,976 Views)