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

Shared Variables Fail When Using Source Distribution

Primary Software: LabVIEW Development Systems>>Full Development System
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Toolkits>>Application Builder

Problem:
Why is that when running a VI from a Source Distribution (running a VI without the project file), my application fails where it is supposed to use Shared Variables?

Solution:
Many different types of errors can occur when running a Source Distribution.

1. When you create a Source Distribution, the Shared Variables are not deployed. Shared Variables are deployed from the project file. The project file, or .lvproj file, is not included in a Source Distribution.* To address this, use Deploy Library under DSC Module»Engine Control»Deploy Library.vi at the beginning of your program.

2. The front panel object for the Shared Variables are bound to the object in the project rather to the network address after the shared variables are deployed.  Therefore, without the project, the front panel indicator on will show red when the program is running as indicated by the screen shot.



This happens when the shared variables is dragged from the project explorer window to the front panel, and the the "data binding" tab of the front panel controls will be referenced to My Computer (project referenced).
Since the project does not exist when opening the VI independently (as in a Source Distribution), the shared variables do not know where to look.  Right click on the shared variable on the front panel, go to Properties, go to the Data Binding tab, select Browse..., and choose Network Items from the drop down menu as shown in the screen shot below. Once you have your library deployed, you will be able to pick the variable to which the front panel control is bound (and these shared variables will only work after you have used Deploy Library.vi)




*Consider using a Zip File as a type of distribution that allows you to include the .lvproj file.

Related Links:
KnowledgeBase 432D4LNZ: Source Distribution Does Not Include LabVIEW Project File
KnowledgeBase 3U0GOJXL: How Can I Transport My LabVIEW 8.0 Project to Other Machines?

Attachments:





Report Date: 11/03/2006
Last Updated: 03/17/2008
Document ID: 432D3HNZ

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