LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Values of controls aren't changed programmatically, unless debug is on. Why?

I am trying to control a VI remotely, by having it parse an input file. When debugging, the everything works fine, but when debug light bulb is turned off, the controls are not updated with the values set in the file. What's the difference between debug mode and normal mode?
0 Kudos
Message 1 of 12
(3,326 Views)
You may have a timing issue in your VI. The execution highlight should affect the speed and nothing else. If you're reading from a file, make sure you are properly opening and closing the input file. Make sure you have all Error Outs wired and that you're not ignoring errors.
0 Kudos
Message 2 of 12
(3,326 Views)
I've also seen execution highlighting mask race conditions. Make sure that you're using correct dataflow programming. Are you using local variables or property nodes to set values?
0 Kudos
Message 3 of 12
(3,326 Views)
I am using local variables. Also, all the values are assigned in the first step of a sequence. In the next step of the sequence, I set an boolean flag, which indicates that the main loop is ready, so timing really shouldn't be the problem...I am pretty sure that solves the race conditions.
0 Kudos
Message 4 of 12
(3,326 Views)
Can you give us any more hints or post your VI?
0 Kudos
Message 5 of 12
(3,326 Views)
I am hesitant to post the VI, because it has dozens of sub-vis, and controls a few instruments..so its probably too complicated to bother with.

Basically it works this way: I have a button to trigger the main function on the front panel. This button is or'ed with a flag that indicates that a remote command (from input file) has been parsed and that the controls have been set. So the main function is fired either when a user clicks the button, or the flag is set.

The flag is set in the very last frame of the sequence which reads the input file and sets the local variables.

Everything works fine, the main function gets fired as soon as the input file shows up, but the controls on the front panel don't change to the values
given in the input file..unless the VI is running in debug mode.

I will try setting the "value" property of the controls to see whether that works.
0 Kudos
Message 6 of 12
(3,326 Views)
Problem solved:

Change "value" property of controls, instead of assinging the value to local variables.

Thanks for the help!
0 Kudos
Message 7 of 12
(3,326 Views)
I would guess problem masked.

Using the value property moved this update into the user thread which is by default single threaded.

As Dennis mentioned earlier execution highlighting will mask race conditions. Execution highlight runs like it is single threaded.

If things get weird on you, Post the top level VI for us to look at.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 12
(3,326 Views)
I agree with Ben and Dennis. Property nodes are slower than local variables. Execution is slower when execution highlight is on. Both of these changes affect the overall timing of your program. If they affect whether or not your program works, your program may not be as stable as it could be. You might not want to declare victory just yet.
0 Kudos
Message 9 of 12
(3,326 Views)
Since my problem may not really be solved, I am posting my VIs here, in the hopes that my real problem can be identified.

The VI works in this manner:

A scan over a range of angles occurs either when
a) user presses the scan button

or

b) the web server puts a file in the c:\data directory called PSWICommand.txt

After the PSWICommand.txt file is parsed, it is deleted.

The top level VI is \Plasmon Spectrometer\Main.vi

This is my first labview project, so please give me any suggestions as to bad style/performance issues, as well as causes for my race conditions (or whatever this issue is caused by).

Thanks,
John
0 Kudos
Message 10 of 12
(3,326 Views)