LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global still not work in compiled executables? V8.0

Thanks, that may be what I end of doing.  I'm getting pretty frustrated with LV vis-a-vis making compiled programs that work like they do in development mode. 

If anyone has any advice for making a shared variable work in an executable using 'single-process' variable types here is a link to a simple example of what I want to do.  A zipped file in message # 14 on the following link has the project files.  TGIF

http://forums.ni.com/ni/board/message?board.id=170&thread.id=287713&view=by_date_ascending&page=2

0 Kudos
Message 11 of 18
(1,164 Views)
"I'm getting pretty frustrated with LV vis-a-vis making compiled programs that work like they do in development mode."

I've heard, on these forums, that the variables aren't really native to LabVIEW, that they don't fit well with its fundamental design principles, and that they were put in with a somewhat recent version so as to help people who are used to other languages; based on this, variables are apparently supposed to be vigorously avoided.

Now, I have no idea whether that's actually true, but I've (somewhat arbitrarily) chosen to follow that line of thinking, and I've found that it solved my problems with compiled programs being different than development builds.

Edit: That said, I'd like to stress that I really have no basis for making general assertions about LabVIEW and that trusting me implicitly would be bad, bad, bad.

Message Edited by DJDDA on 12-07-2007 04:08 PM
0 Kudos
Message 12 of 18
(1,160 Views)
Hi Mike,
I found this knowledgebase that is related to what you are trying to accomplish.  I hope you find it useful.  As it turns out you can use shared variables for what you want but it is not very clear about how to do so.  Shared variables work really well if you are well versed on how they work but if you are not they can quickly turn into a headache.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 13 of 18
(1,146 Views)
I ran that example on my computer and once again it works if 'network-published' style is selected but will not work if you change the variable style to 'single-process'.  Which is what I want to do.    I rebuilt the exe files first without changing anything and set the deploy address approperly.  It worked (sort of).  I then changed the variable type to 'single process', rebuilt and they no longer work.  If you can change the style to single and make it work in an executable please let me know how you did it.
Mike
0 Kudos
Message 14 of 18
(1,141 Views)
Mike,
Single process chared variables are intended to be used in the same application.  I don't think you can use them between compiled executables.  The main advantage for using them over global variables is that you can easily convert them to be network published variables.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
Message 15 of 18
(1,114 Views)
Okay, thanks Eric
0 Kudos
Message 16 of 18
(1,108 Views)
Eric, Perhaps someone needs to amend the Help File from The Shared Variable Properties popup window which says
 
Variable Type—Specifies the scope of the shared variable. Select Network-Published from the drop-down list if you want to share the shared variable data across a network. Select Single-Process from the drop-down list if you want to share the shared variable data among VIs on the local computer.
 
To me that is really misleading
thanks again, Mike
 
Message 17 of 18
(1,104 Views)
Hi Mike,
I see your point and agree that the description is misleading.  I will check into changing the wording for future editions of LabVIEW help.  Even if it is possible to use single process shared variables in multiple exe's on the same computer the LabVIEW help doesn't do a very good job of explaining the process.  However, I do not think it is possible.  Thank you for bringing this to my attention as we are always looking for ways to improve documentation.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 18 of 18
(1,088 Views)