‎03-25-2009 03:12 PM
‎03-25-2009 03:21 PM
Did you look at: http://forums.ni.com/ni/board/message?board.id=170&message.id=291730&query.id=133124#M291730
or
http://digital.ni.com/public.nsf/allkb/21BA0F671A63A60386256CB4004DF99B?OpenDocument
‎03-25-2009 03:33 PM
Also take a look here:
http://zone.ni.com/devzone/cda/tut/p/id/3185
We are currently deploying applications as XP services using this approach. Works very well.
Note that if you intend for the program to interact with the desktop ('Allow service to interact with desktop' in services.msc) you
may have difficulty with other OSs, specifically 2003/2008 Server. Also, depending on the security environment, logging out a
user, even on XP, will cause the UI to break. Easy work around, and probably better architecture to begin with, is to plan for
any UI to go through a web browser to a web exported front panel.
Matt
‎05-05-2009 12:13 PM
I took a look at http://members.cox.net/kuanchen/lvservice/index.html for creating a Windows NT Service but I dont know how to accomplish step 2.
"Link AnyService.dll to the LabVIEW dll created in Step 1"
I downloaded Visual C++ 2008 Express Edition to build dll, but how can I do that?
Julio DÃaz
‎05-05-2009 05:30 PM
‎05-06-2009 09:57 AM
Sorry, I think I wasn't clear in my last post.
I'm developing a program in LabVIEW that run continuosly without user interface, so I want to convert this program to a windows service. I took a look at http://zone.ni.com/devzone/cda/tut/p/id/3185 but I think this method does not provide a gracefully stop. Instead, I'm trying to follow the Kuan Chen's method, about to "create a Windows Service with LabVIEW" (http://members.cox.net/kuanchen/lvservice/index.html).
At the end of step 1 says "Build all the server code into a DLL". I did this: creating a "Shared Library" in "Build Specifications" Project Manager menu on LabVIEW. This procedure create a dll (LabVIEW.dll) with 2 functions BeginService and EndService.
In Step 2 Chen says "...Link AnyService.dll to the LabVIEW dll created in Step 1. Be sure to also link to labview.lib as it is very likely the LabVIEW DLL will use it.". I think it means link a dll to dll (AnyService.dll to LabVIEW.dll). Where do I do that? Is It posible link AnyService.dll to LabVIEW.dll in LabVIEW? or, Do I need do it from Visual C++?. And How to link labview.lib?
I know that if the "link dll to dll" procedure must be done in Visual C++, then I've been searching in the wrong forum, so let me know.
‎05-06-2009 10:12 AM
Try looking at Explicit Runtime Linking and Using explicit runtime linking. If you need more help I'd also take a look at Walkthrough: Creating and Using a Dynamic Link Library on MSDN
It looks like you have to add some code to the AnyService.dll in order to link the Labview dll and lib as external resources.
‎05-06-2009 10:26 AM
juliodiaz wrote:In Step 2 Chen says "...Link AnyService.dll to the LabVIEW dll created in Step 1. Be sure to also link to labview.lib as it is very likely the LabVIEW DLL will use it.". I think it means link a dll to dll (AnyService.dll to LabVIEW.dll). Where do I do that? Is It posible link AnyService.dll to LabVIEW.dll in LabVIEW? or, Do I need do it from Visual C++?. And How to link labview.lib?
I haven't used that procedure, but based on looking over it, then yes, that's what it means. When you build AnyService.dll you have to link in the LabVIEW DLL that contains the BeginService and EndService exported functions. This is done in the Visual C environment. The TestLVService VI simply calls the DispatchService function in AnyService.dll, so it assumes that the LabVIEW DLL has already been linked in. The executable of TestLVService.VI is what gets turned into a service using sc create.