LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using system exec.vi in a web service VI

Hi,

 

I have a simple web service in which I want to open some third party software. I'm experimenting with notepad right now. See the attached image of the web service code. It uses the 'system exec.vi' to open notepad. This works fine in the LabVIEW environment and it works fine when run through port 8001 as a web service. However, when I try to publish the web service and run it through port 8080, notepad doesn't open. I get no  errors back either. It seems to me that the 'system exec.vi' doesn't function the same when deployed as a web service. Any help appreciated.

 

Thanks,

lms17

0 Kudos
Message 1 of 3
(2,731 Views)

Web services run in their own application instance - I don't think it's possible for them to interact with the user interface and as such wouldn't be able to launch notepad (or at least, you certainly wouldn't be able to see it). Think about Windows services - they don't have user interfaces either...

 

Have you looked in task manager to see if it actually launched it or not (perhaps as another user?)?

 

The way I would tackle this would be to run a little LabVIEW application that runs at startup and communicates with your web service and when called, does the system exec to launch the other application in the user session.

 

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(2,719 Views)

Hi Sam,

 

Thanks for the prompt response. I have a workaround similar to what you mentioned using network shared variables to communicate between the start up VI and the web services. I was hoping there was a better way around this but seems unlikely.

 

Just to answer your question, notepad doesn't show up in the task manager. The response I get back is as follows:

 

{"command line":"C:\\Windows\\notepad.exe","error out":{"status":false,"code":0,"source":""},"return code":0}

This indicates that there was no error but notepad didn't open.

 

Thanks,

lms 

0 Kudos
Message 3 of 3
(2,702 Views)