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.
03-21-2018 04:01 PM
First off, this is my first post in the forums. If I should post this in a better place I'll take the constructive criticism.
I was going through the Example Project > Shared Variable.lvproj and a couple of things did not make sense and were not explained by the comments. I am hoping someone could provide clarity.
-In the "Shared Variable Client - Front Panel Binding.vi" VI, the VI continues run even though there is no while loop. What makes this happen?
-What is the functional difference between a Shared Variable and a Bound Shared Variable?
Solved! Go to Solution.
03-21-2018 04:15 PM
Welcome to the forums. This is the appropriate place to post your question.
The VI is running. It has not had a chance to complete its code. It has an event structure in there that is waiting for an event to happen. It has only one event that is waiting for a value change on the Stop button.
A shared variable is part of a library that when it is deployed keeps track of values so that other VI's can access the data. Even VI's on other PC's if you are using network shared variables. Normally you'd have to read data from and write data to the shared variables. When the shared variables are bound, that means a control on the front panel is bound to that shared variable. It will be updated with the SV's value automatically by way of some background LabVIEW processes. (Either direction depending on if it is a control or indicator, and whether the access type is read, write, or read/write.)
03-22-2018 07:01 AM
@jwilliams17 wrote:
-What is the functional difference between a Shared Variable and a Bound Shared Variable?
I think things got mixed up here.
"Binding" variables is used for different concepts:
1) Binding Shared Variables and Other NI-PSP Data Items to Controls and Indicators
2) Creating Bound Variables (DSC Module or Real-Time Module)
03-29-2018 07:31 AM
I get that the VI doesn't end because the Event structure hasn't executed. But without a While Loop, why do the waveform charts continue to query the shared variable value? I would think they would populate one data point and then stop.
03-29-2018 08:13 AM
Because the background process that handles shared variables is updating the screen.
I called is a "LabVIEW process", but actually it is not the LabVIEW run-time system doing it. The development environment is open, but it isn't actively running LabVIEW code. The Shared Variable Service (it might be some variation of that name) that runs in the background continuously is doing the updating because it knows that indicator object is bound to a shared variable.