LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way, i can identify the windows services required for a proper run of my application?

Is there a way, i can identify the windows services required for a proper run of my application?

(despite trail and error)

 

Background, we run an application at the costumer site pc. The application is set to start into autostart, as windows deterimes the order which services/apps starts first, i want to ensure, all services required for my application are already in the desired state. (No i dont want to put a batch with a simple wait function in front of my app or something simiular)

 

To get the status i use .NET in Labview - check the attached snippet.

 

I just need a list of the services, here is what hardware i use:

 

IMAQdx Camera (i guess some service need here)

Variable Engine (For shared variables i guess)

some unkown stuff

 

Any informations are highly appreciated, thanks in advance.

 

Cheers chris

0 Kudos
Message 1 of 9
(3,543 Views)
I'm not sure if I understand your question. If your application needs something that is unique to it (like the SVE) it will start it. If it needs some external resource, there are ways of finding out if they are running.

What exactly is it that you want to check?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 9
(3,534 Views)

Hi mike,

 

i want to check all the resources external or "internal" (LV services) my application needs to run. I can check these already, i use the corresponding .NET assembly for this purpose.

 

I just want to know how i can, lets say, populate a list of all resources (in this case windows services) i need for my application.

0 Kudos
Message 3 of 9
(3,506 Views)
I am not sure how you would know for sure, but again -- why bother? An NI installer will install what you need and start up the resources when your code launches.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(3,484 Views)
Hi again, Well we observed the behavior, launching our App with autostart win7 and Findling it an undevined State not responding. Putting a Delay between (batch and simple wait 20-10s app c#) fixes this. Missing resources is the only reasson making Sense in this case - die me (enlighten me if Necessaire:) ). But looking at the installer components is maybe a good start
0 Kudos
Message 5 of 9
(3,459 Views)
Putting a delay between what? What does your program do? What is your program trying to do when it hangs? What errors are being generated that you aren't handling properly?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 9
(3,447 Views)

In your question order....

 

 

Putting a delay between what?

 

The LV app, isnt in the autostart directly. The autostart includes a batch file. This batch file, starts and wait to end an c# app. This c# starts, waits 20s and shuts itself down. Afterwards the LV app is called from the batch file.

 

What does your program do?

 

It is an program for machine vision inspection. It includes IMAQdx camera implementation, also some external dll for communication to various PLC i.e. industrial ethernet, profibus etc...

 

What is your program trying to do when it hangs?

 

 

It is trying to initialize the cameras.

 

What errors are being generated that you aren't handling properly?

 

-1074360311

 

 

 

Now look, when we put this batch file in front of our applikation, on system startup, it is working fine. Also when you close the app, and start it again - no problems.

 

This happens only on system startup with the autostart without delaying the applikation start. This construct works fine for more than two years now on more than 20 lines.

 

Furthermore, the error gets handled, but i dont want to poll 100x for the error, because the error can be caused through a lack of  ethernet connection too. Router down, pulled ethernet cable and

 

so on.

 

I have now the time to do some refactoring on the project, and this a side point i want to fix (if possible), or lets say to understand first....

 

So back to my original question: Is there a way - without trail and error - to find all services required for my applilkation. (as mentioned earlier - i can check the state, i just dont know which ones are required)

 

Cheers chris

 

0 Kudos
Message 7 of 9
(3,389 Views)

Are you aware that the batch command interpreter cmd.exe also supports wait functionality directly. Using a C# app for that sounds pretty heavyweight.

 

As to your searched information, rather than trying to determine specific services that might change with new driver releases and break your intended workaround, you should tackle this in your application directly. This kind of information is seldom documented since documenting it makes it much harder later on to change anything. And no unless you want to go into disassembly and system level debugging there is no good way to determine these dependencies other than by trial an error! IMAQdx needs all kinds of system level drivers and some of them are specific to your hardware, so NI couldn't even attempt to document what kernel drivers and services are all needed before IMAQdx can successfully open a camera interface.

 

I would rather try directly in LabVIEW to determine when the desired resource (here your camera) is available.

 

It's unclear what happens when you say it hangs. Are you trying to open the camera? You do get an error there, so what prevents you from waiting a few seconds when you receive this error and then try to open it again? Proper error handling in your code means sometimes to catch specific errors and do a retry or some alternative code path.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 9
(3,358 Views)

For the batch, sure, but this is the standard procedure from some old collegue, so why confuse the others...

 

Hm to summarize your statement, it would be very hard to find the service low lever drivers. Well thats what i was expecting after no short repsone to the topic. Guess i will just leave the delay in and put some ping all network connections first and then try to initialize the connections to the cameras....

 

Looks for me this isn worth the time.

 

So thanks everybody for your efforts..

 

Cheers

0 Kudos
Message 9 of 9
(3,342 Views)