LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW as a Service - process stays in memory despite finishing execution

Thanks for your detailed answer.

0 Kudos
Message 21 of 23
(596 Views)

There are of course other ways to talk to a process running as service such as network or file IO. You could place a file in a commonly accessible location on your system and the service could periodically try to read that. Or you can implement a TCP server endpoint in your service that other applications can connect to to send it some commands. I would most likely go for the TCP server interface.

But that all possibly doesn't really help if your service is hanging after it received the Application Close? event in the event structure and then went of to processe all the necessary cleanup functionality before ending itself. There was some sort of bug in LabVIEW since at least 7.0 that would cause the process to not terminate anymore if you filtered the Application Colse? event in the event structure. Basically if you passed a true to the Discard filter terminal to go on and do some other processing before trying to end your program by leaving all loops and closing all frontpanels explicitly the process would remain in memory forever until killed eventhough there was nothing active anymore. Even executing the Application Quit node would not help. Supposedly that was fixed in one of the LabVIEW versions somewhere between 2009 and now but I have never checked that as my workaround to not discard the Application Close? filter event and do all the cleanup processing inside the event structure despite that this is bad design, worked flawlessly.

And no this was not for a Windows service but a background deamon that runs inside the Lua for LabVIEW toolkit.

 

For Windows service functionality we use a toolkit in our company that communicates directly to the service control manager in Windows through a custom made DLL.

Rolf Kalbermatter
My Blog
0 Kudos
Message 22 of 23
(581 Views)

Currently in my dummy application I don't have any events implemented. 
I haven't implemented the event structure, because if I remember correctly, I couldn't trigger those events with win32com library. It is as plain as possible, only some controls and indicators are there, that I want to read.
Do you think the event structure is obligatory for this task? Because that would mean we would have to modify the source code, which is bad news. 

Also could you show me maybe that workaround that you mentioned?

0 Kudos
Message 23 of 23
(572 Views)