Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
3 ratings:
 3 out of 5     Rate this Document

Why Do My Shared Variables No Longer Work When I Deploy My Application ?

Primary Software: LabVIEW Modules>>Real-Time Module
Primary Software Version: 8.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
My application with a CompactRIO target and Shared Variables works fine on my development machine when I create an executable. However, when I run the .exe on the deployment machine, no data is passed through the shared variables but no error message is given and the code seems to be running fine.

Solution:
Note: The steps in this document are only necessary if the Autodeploy Variables option of your variable library must remain checked.  If this option is not necessary, instead see KnowledgeBase 3V0H36XL: Why Do I Receive a Deployment Error When Running a Host VI With a Startup Real-Time Executable?

When you make an executable of a project using shared variables, you can have a local copy of the variables on the deployment machine which are then bound to the 'real' shared variables stored on the target - the CompactRIO in this case.  This will prevent the deployment of the PC variables from affecting the variables deployed on the RT target.

This means your Project View would look something like this:



Note: The two libraries can have variables with the same name as they are not both on the local machine.

The steps required are:

1. Create shared variables in the normal manner on the cRIO:



a. Right-click on the target 
b. Select New»Variable
c. For Variable Properties, enter Name (stop); Data type (Boolean) and Variable type (Always Networked-Published)

2. Create shared variables on the Host PC: 
a. Complete steps 1a-c
b. Right-click the Enable Aliasing Checkbox



c. Bind to PSP URL, click Browse - and select variable on target:



d. Click Ok

Note: There is an update for only LabVIEW 8.6.1 to fix an issue where the bound variable path is incorrect after variable deployment. This could cause error code -1950679023 among others. To correct the issue please download the patch from LabVIEW Base Development System 8.6.1 - Windows 2000/Vista x64/Vista x86/XP - Bound Variable Fix and replace the affected library.

Note:
The Run Time Engine also uses this DLL, you will need to replace same DLL listed in the patch.  The DLL can be found at National Instruments\Shared\LabVIEW Run-Time\8.6\nitaglv.dll

Related Links:
KnowledgeBase 3V0H36XL: Why Do I Receive a Deployment Error When Running a Host VI With a Startup Real-Time Executable?
KnowledgeBase 3UCBHM8T: How do I deploy Network Shared Variables from a Compiled Executable?
KnowledgeBase 4R5L2OMO: Where Is My Deployed Shared Variable Stored?
LabVIEW Base Development System 8.6.1 - Windows 2000/Vista x64/Vista x86/XP - Bound Variable Fix

Attachments:





Report Date: 10/27/2008
Last Updated: 06/04/2009
Document ID: 4QQ9FCCX

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit