10-09-2019 07:49 AM
Hello everybody.
I've set the disabled property node of my dialog boolean boxes and string controls to enable and disable in my code.
The main idea: I have 16 dialog boolean boxes and 16 string controls. I want to set every dialog boolean box and string control to be enabled only after the previous dialog boolean boxes and string controls had been set (for example, the dialog boolean box and string control number 3 will be enabled only after I've checked the dialog boolean box number 1 and 2. until then, the dialog boolean box and string control will be disabled and grayed).
I use the Disabled property node of the dialog boolean box and string control in order to do that.
My problem is that the dialog boolean box and string control is been changed to enable only when I stop the LabVIEW running and start it again. It doesn't update the property node to be enabled while the LabVIEW is running.
I want it to be updated continuously while the LabVIEW is running without needing to stop and start the continuous run every time.
Do you know how do I do that?
Thanks,
Reshef
Solved! Go to Solution.
10-09-2019 08:14 AM
First, put a wait function in that VI so that it isn't burning up your CPU.
The problem is you have a case of "localitis". Why are you using local variables of your booleans to control the enable/disable rather than the wire coming from the boolean terminal itself?
Even despite all that, your VI worked okay for me once I deleted the missing subVI.
10-09-2019 08:32 AM
What is the missing vi doing? Are you able to stop the vi with the Stop button or are you using the Abort button in the toolbar? It also worked for me when I delete the missing vi. I suspect that your real problem is that the program is getting stuck in the missing vi.
10-12-2019 03:15 AM
Hi.
It's now working for me as well. I don't know why it didn't work before but everything works fine now.
Thanks anyway for all the help!!
10-12-2019 11:10 AM - edited 10-12-2019 11:13 AM
@resheffink wrote:
It's now working for me as well. I don't know why it didn't work before but everything works fine now.
Unless you fixed all the mentioned race conditions, i is NOT fine, because the problem can occur again at any time. Your code is not safe.
Can you describe in a few words how the code is supposed to behave?
10-12-2019 01:38 PM
Following my suggestions above, here's a simplified version for four items. You can easily expand it to any number of items by just increasing the arrays accordingly. No other change in code needed. This is called scalability! Notice that there is no longer any duplicate code or local variables!
See if this can give you some ideas. Good luck!
(As I said, further optimizations are required. For example the lower FOR loop only needs to execute whenever the boolean array changes, so place it inside a case structure. Not shown)