LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DSC application as Windows Service conflicts with other DSC application

I have built a SCADA application using Labview and DSC 7.1 in Windows 2000 and it works fine.
I have been requested to make it run as a Windows Service in order to make it independent from Windows logged user.
The application is designed to have a FrontEnd (equipment data retrieval) a Database (DSC) and a Human Machine Interface (HMI). FrontEnd runs on PXI-RT, DSC and HMI run on Windows2000 PC with DSC runtime installed. This PC is where I am trying to use Windows Services.

On the PC I have a 'main.exe' which:
- starts DSC
- starts Vi based server to get data from FrontEnd
- starts HMI

My idea was to transform 'Main.exe' into a Windows Service, detach HMI from Main, and let HMI.exe be started by Windows logged user. Data retrieval from Front End and data logging into Citadel would then always run as a service.

To transform 'Main.exe' into a Windows Service I followed instructions found in:
http://zone.ni.com/devzone/conceptd.nsf/webmain/A9B2FA96B851394586256B26006ECB98?opendocument

have tried :
- srvany.exe (Microsoft Windows resKit)
- FireDaemon-Lite-1_5_1-GA downloaded from
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/21ba0f671a63a60386256cb4004df99b/$FILE/FireDaemon-Lite-1_5_1-GA.exe

Both of them did the job OK.

Actually Main.exe becomes a Service and runs at Windows startup as expected, it starts DSC and all Front End connections work fine.

Problems come when trying to run HMI.exe once logged in as Windows user: HMI should read/write DSC tags but doesn't find DSC related vi and I get 'LabVIEW load error code 21', see HmiLaunchingError.bmp in the attached errors.zip

Note that:
- everything works fine if I start both Main and HMI after Windows login (without starting Main as a service)
- Both Main.exe and Hmi.exe are into National Instruments\LabVIEW DSC Run-Time System 7.1 directory
- nothing changes allowing 'Main' service to interact with Desktop (Windows Services Properties)
- Same problems launching Start>>Programs>>National Instruments>>LabVIEW DSC Run-Time System 7.1,
see DSCRTLaunchingError.bmp in the attached Errors.zip

It seems that any DSC related application, launched after 'Main' service has started, has no possibility to find its Vis in library, a sort of file hiding happens...

Can anybody help me to understand?

Thank You
0 Kudos
Message 1 of 7
(4,514 Views)
If I understand you correctly, when the main.exe is started as a service, the big problem is that the HMI started by a user is not finding VIs.
Is this happening with any users? What happens if the user that runs the HMI is the Administrator for that machine?

This could be a hint to set us on the right track to investigate the problem and find a solution.
Also, by looking at this KnowledgeBase I noticed there are a lot of configuration settings that can be specified when creating the service from the executable.
My best guess is there is some problem with access to the directories where the exe and HMI point when calling SubVIs or DLLs and this causes the error 21 to show up.

Let us know what happens with an administrator user and we will investigate more into this,
regards

AlessioD
National Instruments
0 Kudos
Message 2 of 7
(4,500 Views)
AlessioD wrote: If I understand you correctly [...]is not finding VIs.
- Yes You are right! And only DSC related Vis are missing.

Is this happening with any users? What happens if the user that runs the HMI is the Administrator for that machine?
- I tried this with an user belonging to Administrators group, not with normal user.

[...] I noticed there are a lot of configuration settings that can be specified when creating the service from the executable.
- I tried some of them not all: no change to the problem I have.

My best guess is there is some problem with access to the directories where the exe and HMI point when calling SubVIs or DLLs and this causes the error 21 to show up.
- Yes, all DSC subvis are there, it seems that the 'DSCEngine.exe' environment started as a service, hides Vis to HMI.exe started under user login.

Thank You AlessioD
0 Kudos
Message 3 of 7
(4,481 Views)
Hi,

we are investigating your issue.
What is the communication method between the Main.exe and the HMI.exe?

While we look at the issue, you may want to try and configure the HMI.exe to start as a service also and then implement a simple user application that communicates with this Windows service through TCP/IP or VI server, and can be used as the HMI service interface.

Regards

AlessioD
0 Kudos
Message 4 of 7
(4,460 Views)
we are investigating your issue.


What is the communication method between the Main.exe and the HMI.exe?

While we look at the issue, you may want to try and configure the HMI.exe to start as a service also and then implement a simple user application that communicates with this Windows service through TCP/IP or VI server, and can be used as the HMI service interface.

Regards

AlessioD


0 Kudos
Message 5 of 7
(4,455 Views)
forget my previous reply... Thank you for your interest.

HMI.exe mainly:
- read and writes data to/from DSC engine through 'Read Tag.vi' and 'Write Tag.vi'
- uses some global variables written by Main.exe
- allow user to move into a 'tree-style' panels structure to monitor and command equipment
- display a event/alarm history windows connected to the DSC Engine

Starting HMI as a Windows service seems to be useless since it needs user interaction. Anyway I need to have DSC Runt time window available to windows logged user, i.e. it wouldn't solve the problem I have when launching Start>>Programs>>National Instruments>>LabVIEW DSC Run-Time System 7.1

thank You
0 Kudos
Message 6 of 7
(4,452 Views)
I suggest you call us directly at:

+39. 02.41.30.92.17 (Italy)

and get directly in touch with our Support Team to handle this issue more in depth.
thanks,

AlessioD
NAtional Instruments
0 Kudos
Message 7 of 7
(4,441 Views)