LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

starting an application using VI server

hi

I have simple task to achive, i want to start application say app1.exe from app2.exe. i thought i can do this my using Vi server. I tried achiveing this using "open application referance" after getting the referance of application i give this referance to "open VI referance" function, i specify the name of the main VI in app1.exe say app1.vi, and then use invoke node to run the main VI.
Is this the procedure to start an application? am unable to achive this becuase the "open application referance" does not take any path, it takes only machine name. if it does take a path how do i specify it?

Thanx for the reply in advance
Regards
Arun
0 Kudos
Message 1 of 12
(4,338 Views)
VI server will open a reference to a version of LabVIEW, not to a particular EXE. This is why it only asks for the machine name, because it assumes you're making contact to another LabVIEW system.

What you need is much easier. If your program is already available as an EXE, you can run it simply by using the "System Exec.vi" under the "Communications" palette.

Here you can give in the command prompt including the path and name of your program. This should be enough. Additionally you can set whether the system exec should wait for the program to finish or not.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 12
(4,332 Views)
This will probably work, but you need to know the exact path of the VI. Use "Current VIs Path" from the File I/O>>Constants palette and run it when it is an EXE to find the full path and wire that directly into Open VI Ref.
The better way is probably to use System Exec, from the Communication palette, to call the EXE and set Wait Until Done to F.

___________________
Try to take over the world!
0 Kudos
Message 3 of 12
(4,334 Views)
Hi all thanx for your responces, but i am sorry i forgot to mention 1 thing, i.e the exe should be run in a RT system, so there is no way i can use command prompt i guess. Do u think it is better to create a .llb and run the VI's when necessary? i initially planed to create a application of each VI and call it seperately. will it make any difference if i make an .llb file and call the VI's or create an exe of each VI and call them seperately.
0 Kudos
Message 4 of 12
(4,323 Views)
I never tried running 2 EXEs in parallel on a RT system, so I don't know about that. I'm not sure, but I believe System Exec should work on RT targets.
I would say go with the llb because it saves you the need to build the app each time and manage path changes and so on. I don't think that you have any advantage in having 2 seperate apps if you run them programmatically.

___________________
Try to take over the world!
0 Kudos
Message 5 of 12
(4,320 Views)
Thanx a lot for your replies,

I have decided on using VI's as llb and storing them in the RT target and using VI server to sequentially start all the required VI's, am trying this on windows, but if i dont set the property "frount panel open" the application does not start. Is it mandatory that i shd open the frount panel to run the VI, in that cse this may not work in RT target as there will be no frount panel.
please give me your opinion

Thanx
Arun
0 Kudos
Message 6 of 12
(4,313 Views)
VIs on a RT target CAN have a front panel. I believe a top level VI has to have a front panel.
Are you using the Run VI method to run the VIs? This method definitely doesn't require that the FP will be open.

___________________
Try to take over the world!
0 Kudos
Message 7 of 12
(4,311 Views)
hi am attaching the 2 VI's am using, run this.vi to run the ds.vi which connects to datasocket server when run, this is to make sure the Vi has started, with out FP the VI never runs which can be confirmed by cheking if any application is connected to DS server, another observation i made is if i set "wait until done" the VI runs fine and connects to the DS server.
0 Kudos
Message 8 of 12
(4,299 Views)
I don't understand what you're saying, but I'll make a couple of point:
1. I'm not big on DS and I don't know what (if) FP supports it.
2. I think you need to have at least one VI with an open FP, but I'm not sure. If the only difference between it working and not working is that, then that seems to be case.
3. I didn't understand your example. The third VI wasn't there, and I didn't understand exactly what the problem is. In any case, you shouldn't have a problem using VI server to run a VI on a FP.

___________________
Try to take over the world!
0 Kudos
Message 9 of 12
(4,294 Views)


Angelantoni a écrit:
hi

I have simple task to achive, i want to start application say app1.exe from app2.exe. i thought i can do this my using Vi server. I tried achiveing this using "open application referance" after getting the referance of application i give this referance to "open VI referance" function, i specify the name of the main VI in app1.exe say app1.vi, and then use invoke node to run the main VI.
Is this the procedure to start an application? am unable to achive this becuase the "open application referance" does not take any path, it takes only machine name. if it does take a path how do i specify it?

Thanx for the reply in advance
Regards
Arun




If you want to start app1.exe from app2.exe use "System Exec.vi" and input the full path of app1.exe.

"Open Application Reference" opens a reference to an already running LabVIEW (development or built app.) to use its VI server.


LabVIEW, C'est LabVIEW

0 Kudos
Message 10 of 12
(4,056 Views)