LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

checkbox boolean control not setting

I've attached my labview 6.1 VI.
 
Why isn't the checkbox named "save to file" working?
 
Thanks,
Steve
0 Kudos
Message 1 of 10
(3,517 Views)
 Smiley Surprised  I guess I forgot to attach the VI. 
 
Please see attached VI.
0 Kudos
Message 2 of 10
(3,508 Views)
If you initialize the  Save to File?    to True, I expect it to work.
currently if it is false, the inner while loop is getting a blank  filre  reference
0 Kudos
Message 3 of 10
(3,500 Views)
You've got some design issues. A while loop in LabVIEW (actually in any language), will not pass values out until the while loop completes. You need Start to be true in order for the case statement around the file write case statement but the only way to get a value out of the while loop is to stop it with the Quit or Start button. Until you do that, the while loop is running and no front panel controls are read. You have the same issue with the data from the acquisition. It won't pass out the while loop until it finishes. I think you should look at the capabilities of the event structure. You could have one while loop handling the data acquisition and another handling user events. You could write the data acquisition values to a queue and and in the event handler, read the queue when necessary.
0 Kudos
Message 4 of 10
(3,493 Views)
Hello,
 
Thanks for the reply.
 
I initialize the "Save to File" Checkbox to false at the beginning of VI execution.   During the Upper while look, the user is able to set or clear this text box.   However, this doesn't seem to be working. 
 
Steve
0 Kudos
Message 5 of 10
(3,490 Views)

Hello Dennis,

I set my message at about the save time you sent yours.  I'm still digesting your message.

Thanks,
Steve

0 Kudos
Message 6 of 10
(3,486 Views)

Hello Dennis,

I moved the checkbox control inside of the outer while loop, and it seems the vi is working now.

I did look at the event structure when I started having problems.  I just thought correcting this problem would be simpler than changing to a different design.   Also, I didn't realize the VI doesn't read the controls in the while loop, ie. the button controls.

Please see attached VI.

Thanks,
Steve

0 Kudos
Message 7 of 10
(3,485 Views)

Wow twice in one day!  Smiley Sad

Please attached VI.

0 Kudos
Message 8 of 10
(3,485 Views)

Your VI still has still some "issues" with the "save to file" mechanics.

You should NOT use local varables inside the inner loop for this boolean, because this setting should probably not be changed during run. For example of you would switch it from on to off during run, the file will not get closed at the end! If you turn it on during the run, you might try to write to a file that has not been opened.

The modification shown in the attached image shows how this should be wired directly instead. (I highlighted the new wire).

Also, on the left you initialize using two property nodes. You should wire the error out to the edge of the big while loop to ensure this takes place before the main loop starts. if there is no dependency, there is theoretically no guarantee what happens first. (see red insert in attached image).

(I haven't looked at the rest of your code).

 

0 Kudos
Message 9 of 10
(3,477 Views)
Hello Altenbach,
 
Thanks.  I didn't know that the property nodes had an error out (I'd better read the docs more ofter).   This will allow me to control the execution order.  I made the nodes you spoke about and It looks like it working better know.  Also I changed the "Quit" button design.  Previously the quit button didn't work for the DAQ while loop.
 
Please see attached vi.
 
Thanks,
Steve   
0 Kudos
Message 10 of 10
(3,469 Views)