From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-15-2019 01:44 AM - edited 02-15-2019 01:45 AM
I build a functional global variables in a LabVIEW project, and I use it both in VIs and TS sequence files correctly. However, when I generate a EXE from VIs, the functional global variables don't work well in the TS sequence. How can I deal with it?
02-15-2019 06:55 AM
@GrayJoker wrote:
[...] However, when I generate a EXE from VIs, the functional global variables don't work well in the TS sequence. How can I deal with it?
Brutal answer: Do not use global data storage.
The reason is that the global variable you are using from TS is (presumably) still a "stand-alone" global while the EXE uses an internal one. More details can be found when digging into the topic "Application Instance" in LabVIEW.
I strongly recommend to use parameters to pass data between TS, code modules and the UI and NOT using global data structures.
(The alternative to rewriting stuff would be configuration of the LV adapter in TS to use your EXE as runtime environment for LV which requires your EXE to provide an ActiveX interface. This is presumably equal amount of work compared to implement a proper solution.)
02-15-2019 07:05 AM
@Norbert_B wrote:(The alternative to rewriting stuff would be configuration of the LV adapter in TS to use your EXE as runtime environment for LV which requires your EXE to provide an ActiveX interface. This is presumably equal amount of work compared to implement a proper solution.)
Or compile the globals into a Packed Project Library and make sure you are only calling the PPL globals.
02-15-2019 07:20 AM
@crossrulz wrote:
@Norbert_B wrote:(The alternative to rewriting stuff would be configuration of the LV adapter in TS to use your EXE as runtime environment for LV which requires your EXE to provide an ActiveX interface. This is presumably equal amount of work compared to implement a proper solution.)
Or compile the globals into a Packed Project Library and make sure you are only calling the PPL globals.
Did you test this? It still can lead to two different global VIs in memory in different application instances.... (i assume at least)