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-23-2006 07:15 PM
02-23-2006 07:56 PM
02-23-2006 08:16 PM
Yes, I'm using a stop button. But no matter how I stop the VI, the runtime-modified property settings persist. I could save the "startup" property values and restore these when I hit the stop button. Among the cons to this approach are:
I have many controls and my VI is still a work in progress. As I remove and add controls, this can get to be unmanageable.
This approach won't work if I "kill" the VI mid-stream during debug.
I can't believe there is not a checkbox setting in LabVIEW somewhere that says something like "run-time property settings persist" where the property settings changed at runtime persist or don't after the VI is stopped depending on the state of said checkbox. I'm coming from a VB perspective. Such a things seems elementary to me.
Thanks,
Bill
02-23-2006 08:59 PM
Hi Bill,
It may seem "elementary" to you, but I would say that moving stuff around on a LabVIEW front panel during execution isn't all that common of a use case (I've actually never heard your feature request in my 7 years of LabVIEW development). I agree that making controls visible/invisible is handy, but generally in this case, there is initialization code when the VI runs that makes everything visible/enabled/disabled/whatever, so at least when your VI first runs, it should always be in a default, expected state.
I'm curious...what kind of app are you writing where there are many controls moving around and becoming visible/invisible on the front panel? I make no promises, but maybe there's a way to accomplish what you need without moving stuff around a lot.
-D
02-24-2006 02:54 AM
Like altenbach said, you should reset the controls when stopping the program. Do that using a sub-vi.
Now, during debugging/programming you simply call that same sub-vi at the start of the program as well. Even when you've aborted during debugging, the default state is nicely restored.
I've done something similar. In my program, I disable most of the front panel during a measurement. Only 'cancel measurement' and 'stop' are enabled. I have an enable and disable front panel sub-vi. I simply call the enable front-panel at the very start of the program, and at the end. (No reason to remove it at the start. It takes no time at all... Totally insignificant to the rest of the initialization of my program)
Check the vi's I attached. It doesn't always have to be very difficult/laberous to write... You can get a reference to all controls, and use a loop to select certain ones by name. (Many thanks to JaredW who showed me this approach a little while ago)
02-24-2006 04:24 AM - edited 02-24-2006 04:24 AM
Message Edited by altenbach on 02-24-2006 02:25 AM
02-24-2006 04:40 AM