LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global variables not working in runtime

I have written a testing app for integration with a Solartron 1260 and 1287.  The problem is that I used some global variables to maintain some display features on the main panel.  The problem is that it works fine in the Labview 8.6.1 development environment, but does not work when I run the compiled executable in the runtime? 

 

I'm sure that I am just missing something but cannot figure out what it is. 

 

All my psp led lights stay red in the runtime and green in the development environment.

 

Thanks

0 Kudos
Message 1 of 11
(5,319 Views)

Attached are the pics of the development and the runtime respectively, the runtime led's for the psp variables are red, but the development is green.

 

I initialize all my variables @ the beginning?

 

Thanks

Download All
0 Kudos
Message 2 of 11
(5,317 Views)

Sounds like a race condition. You have to be really careful when using Globals. They are slow and can easily give you a chase or race condition.

 

Without seeing your code I would have to guess this.

Tim
GHSP
0 Kudos
Message 3 of 11
(5,306 Views)

Looks like when I mouse over the psp led, it says 0x0000002A error connecting to my computer .....

 

The message flickers so fast I can't tell what it's saying.

 

0 Kudos
Message 4 of 11
(5,302 Views)

Attached is my installed software out of MAX, is there anything that I need to do to specify which runtime to use? 

0 Kudos
Message 5 of 11
(5,297 Views)

Strange how  Run-Time 2009 SP1 is listed in MAX, but you cannot uninstall it and is not listed in the National In National Insturments Software configuration screen?

0 Kudos
Message 6 of 11
(5,284 Views)

It looks like you are talking about shared variables and not global variables. Those are two completely different things. Here is something from the help for shared variables.

 

Shared Variables and Stand-Alone Applications or Shared Libraries

If you plan to distribute a stand-alone application that uses shared variables, do not include the .lvlib file in an LLB or in the executable. Use the Source File Settings page of the Application Properties dialog box to change the Destination of the .lvlib file to a destination outside the executable or LLB. You can deploy the shared variables in two ways:

  • Write the application so that it programmatically deploys shared variables at start time. Call the Deploy Library method in the top-level VI of the application. In the Library Path input of the method, use the relative path to the .lvlib file that contains the shared variable.
  • Manually deploy the shared variables to the computer or target Shared Variable Engine before running the built application.

If you plan to distribute a shared library that uses shared variables, do not include the .lvlib file in the shared library. Use the Source File Settings page of the Shared Library Properties dialog box to change the Destination of the .lvlib file to a destination outside the shared library.

=====================
LabVIEW 2012


0 Kudos
Message 7 of 11
(5,279 Views)

Ok, on the previous project that I did this to they had the full Labview installed and I did not have to do this with the Runtime? 

 

I modified the build specifications to put it in the support directory.  But I cannot seem to be able to call load/deploy the variables @ startup from the main vi. 

 

I  tried the createoraddlibrarytopoject.vi but still seems to be a nogo.  I attached how I am attmpting to add it

 

Thanks for your help.

 

0 Kudos
Message 8 of 11
(5,264 Views)

Can the runtime environment create shared variables? 

0 Kudos
Message 9 of 11
(5,241 Views)

tartar813,

 

Are you creating before build?  or are you actually trying to create the variable in runtime?   It is my understanding that the runtime environment can't "create" variable.  If the variable is created on your development machine in the code before you distrubute it can create a referent to it in runtime.

 

-Peter

Peter C.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 11
(5,204 Views)