Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

EPICS PV is not working in exe file

Solved!
Go to solution

Hello all. I'm using LabVIEW 2011. I tried a simple application to publish a PV in a EPICS Server. Everything runs well when I start the application inside LabVIEW. The problem occurs when I build an exe. When the exe is running I can see the shared variable updating in NI Distributed System Manager, but the PV VAL field keeps showing No Known Value. If I click on Stop button inside de EXE, run the application inside LabVIEW, stop the application in LabVIEW an press the Run button in the EXE, then the PV keeps updating normally.

 

Application VI:

SimplePVUpdate_VI.png

 

Project organization:

SimplePVUpdate_Project.png

 

EPICS Server configuration:

SimplePVUpdate_EPICSServer.png

 

Shared Variable Build Configuration:

 SimplePVUpdate_Build.png

 

Result running EXE (shared variable updating values, but not EPICS PV):

SimplePVUpdate_ResultEXE.png

 

Result running inside LabVIEW (Ok):

SimplePVUpdate_ResultLabVIEW.png

0 Kudos
Message 1 of 9
(5,878 Views)

Hi Marciodo,

 

In the EXE Build specification, under Additional Exclusions, check the option "Disconnect Type Defs", then rebuild EXE.

 

Regards,

Abel Souza
Engenheiro Eletrônico
LabVIEW User since 8.5
0 Kudos
Message 2 of 9
(5,861 Views)

Hello, Abel. I checked the option and rebuilt as you suggested, but the result is the same.

0 Kudos
Message 3 of 9
(5,858 Views)

You van verify if you check option to deploy shared variables during application execution.

 

http://digital.ni.com/public.nsf/websearch/04D9A85B6967EE87862571140065EEC6?OpenDocument

 

Abel Souza
Engenheiro Eletrônico
LabVIEW User since 8.5
0 Kudos
Message 4 of 9
(5,853 Views)

Hello, Abel. In the fourth image of my post I showed this option already checked.

 

In the fifth image I showed the shared variable AIA0 working correctly, but not the PV IR:NI9215A:AI0, that is associated with the shared variable AIA0. In fact, when I run the EXE, I can see some messages showing quickly and some of them say that the variables are being published.

0 Kudos
Message 5 of 9
(5,849 Views)

On cRIO you are running an RT EXE or a VI?

Abel Souza
Engenheiro Eletrônico
LabVIEW User since 8.5
0 Kudos
Message 6 of 9
(5,844 Views)

Abel, I forgot to mention that I'm not using a cRIO in this build. I'm running the EXE in Windows. The "crio" in the names of the project objects are from a previous test.

0 Kudos
Message 7 of 9
(5,828 Views)
Solution
Accepted by topic author marciodo

Marciodo,

 

I think Abel's suggestions are pretty good. Based on your description it looks like your library is not deployed when you run it as an exe despite the fact you have it checked in the build spec.

I would also try selecting "Undeploy shared variable libraries at application exit" and see what happens.

 

If this doesnt work then I would implement a programatic library deployment. That is also covered in the KB Abel shared earlier.

 

Just curious, are you testing everything (exe and vi) on the same computer? Is LabVIEW project open while you run your exe? I dont think this should matter but curious to see if it has any impact on your problem. 

Also put a Wait function in your while loop so you dont rail your CPU.

 

Miro_T

 

0 Kudos
Message 8 of 9
(5,816 Views)

Hello, Miro.

 

In fact, implementing a programatic library deployment did the work. Now I can run it perfectly. But, until now, I can't understand why the building spec did not work. I even could see the messages in pop-up saying that the EPICS server and PVs where being deployed.

 

Answering your questions:

- Select "Undeploy shared variable libraries at application exit".

        - Didn't work.

 

- Are you testing everything (exe and vi) on the same computer?

       - Yes.

 

- Is LabVIEW project open while you run your exe?

      - I tested it with LabVIEW opened and closed. I also rebooted the computer and tried to run the exe before LabVIEW with no success. The only way it worked was running the exe, pressing the Stop button, running the application in LabVIEW, pressing the Stop button and pressing the Play button in exe application. Quite a wierd behavior.

 

- Put a Wait function in your while loop so you dont rail your CPU.

     - In fact I forgot it. I built this test application in a hurry because my original code was not working and I needed to remove the most complexities to isolate the problem.

0 Kudos
Message 9 of 9
(5,650 Views)