LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

linking windows service with LabVIEW DLL

I need to write a windows service that executes functions written in LabVIEW upon start and stop. And yes, I've considered using srvany.exe but that won't cut it. I have a LabVIEW function that the windows service (written in VS C++ 6.0), calls when the service stops. Right now, the VI is very simple, long foo(char str[]), and returns a constant. The problem is that the service just sits there when I start the service. I get a "Error 1053: The service did not respond to the start or control request in a timely fashion". From the debugger, it look as if a thread just hangs.  Has anyone ever encountered this before?


Thanks,
0 Kudos
Message 1 of 4
(3,504 Views)
Hi kcareo,

So you got the service control handler working, did you (link to thread)? Good for you.

It seems to me that your problem now is quite simple: you also need to handle the service start message in you handler. In fact, you may need to implement handlers for other control functions as well. But, once you've managed to get a working handler function, it should just a matter of properly responding to the control argument. Depending on what you need to do, you could either set up another occurrence, create some mechanism to pass the argument into LabVIEW, or simply respond from the C code.

Jason
0 Kudos
Message 2 of 4
(3,491 Views)
And make sure the LabVIEW runtime system is installed on the computer too and for any user on that machine. A LabVIEW DLL can't be loaded if the runtime system is not present or not accessible from  the currently logged in user, which for a service is in fact no user at all.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 4
(3,488 Views)
I finally was able to create a Windows service by linking in a Win32 DLL containing the service dispatcher and control handler code to LabVIEW code. http://members.cox.net/kuanchen/lvservice/index.html outlines one way that this could work.

0 Kudos
Message 4 of 4
(3,455 Views)