原创 怎样在两个EXE程序中使用共享变量

2007-12-12 13:12 3574 8 8 分类: 测试测量

How do I Communicate Between Multiple LabVIEW Executables using Shared Variables?

Primary Software: LabVIEW Development Systems>>Professional Development System
Primary Software Version: 8.0
Primary Software Fixed Version: 8.0.1
Secondary Software: LabVIEW Toolkits>>Application Builder



Problem:
I have developed two executables and need to pass data between the two. How is this done using shared variables?

Solution:
In order to communicate between multiple executable applications using the shared variables it is important to use one LabVIEW Project. The project should contain all of the Build Specifications for each executable that is to be built.

In order to use shared variables they must be deployed, and when using them with executables it is important to explicitly do this as it cannot be automatically achieved as it normally can within the LabVIEW environment.

This is best achieved programmatically using VI Server and is fully documented in the following document:


How Do I Deploy Network Shared Variables From a Compiled Executable?


One common pitfall is including the Project Library that hosts the Shared Variable(s) within the Executable itself as this is the default destination. Whilst configuring the Build Specifications settings, remember to change the Libraries Destination to the Support Directory or another Pre-defined Directory.



 




An example project is attached to this document and can be used to demonstrate the behaviour. Remember to check through all of the Build Specification Settings in order to resolve any file paths to suit the local machine.

Related Links:
How Do I Deploy Network Shared Variables From a Compiled Executable?


Attachments:


Build Specs.JPG - Build Specs.JPGShared Variable Executable Example.zip - Shared Variable Executable Example.zip
BuildSpecs - BuildSpecs.JPG
SourceFileSettingsCropped - SourceFileSettingsCropped.jpg
PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
8
关闭 站长推荐上一条 /3 下一条