LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Launch VI on Webservice Deploy

I need to run an initialization (eg open database reference) and start a process in the background (eg collecting measurements for later historical reporting) when ever my webservice starts. Ideally, this would happen even before any web browser client connects. Is there a good way to do this? I need to use global variable instead of shared variables because I need to share memory references (eg database references). I think what I'm looking for is almost a bit like what a startup VI is to an EXE build.
Message Edited by InfiniteNothing on 01-15-2010 09:29 AM
CLED (2016)
0 Kudos
Message 1 of 5
(2,686 Views)

This depends on if you are creating an executable or just deploying through the project.  If using an exe, you have to have a startup VI anyways, and you can  have your configuration code in this.  To do this, see the Web Services FAQ for more info.  If doing it through the project, it might be more tricky.  You can set up a URL Mapping that will run your initialization VI.  Then you can call this manually when you first deploy.  Alternately you can check an INI key every time a VI is called that sees if it is the first time it's been run and if so, run your initilization code.  However this idea seems a bit more complicated and may not be worth it.


Just a few ideas.  Hopefully one leads you to success. 

0 Kudos
Message 2 of 5
(2,658 Views)

My understand is that the webservices are "sandboxed" so that the globals from the launching exe are not accessable from the webservice itself. That's why all the examples use shared variables. Otherwise, that might be a good option.

 

As far as the "from the project" goes, those ideas won't work (aside from the manual one) because I need it to start before a client browser connects.

CLED (2016)
0 Kudos
Message 3 of 5
(2,634 Views)
Not 100% sure if this is the case, but if so why do you need to use globals?  You can do the same thing and use shared variables and it should still do what you want.
0 Kudos
Message 4 of 5
(2,622 Views)
You can't share a refnum (like a database refnum) through a shared variable.
CLED (2016)
0 Kudos
Message 5 of 5
(2,598 Views)