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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reinitialize to default

Hi, I am hoping someone can help me. I have written my test program and everything it should be doing it is.....except for reinitializing. Whatever was in the indicators when the test is started is automatically written into excel. Is this because I have yet to create my executable. Any help that anybody can give is greatly appreciated. I have attached the code.
 
Thanks
Chris Gallo
0 Kudos
Message 1 of 3
(2,265 Views)
This has nothing to do with creating an executable. This has everything to do with race conditions. Smiley Wink

You have a single loop and two case structures which are independent. This means that as long as the operator control is not empty, both case structures will execute. The bottom case structure writes the values to Excel. It writes whatever values are there, even though they may not have been updated or initialized yet. It seems to me that you want to write to Excel once you've actually gotten the values. This means that you should have an additional case in your upper loop's state machine that is something like "Write Data", in which you place the code to write the data.

Also, there's no point in having a separate case structure to handle "Begin Test" to reinitialize the indicators. You already have a state for "Begin Test", so just place initialization stuff in there.
0 Kudos
Message 2 of 3
(2,259 Views)

Thanks for the input.... It works wonderful now.

 

Chris Gallo

0 Kudos
Message 3 of 3
(2,232 Views)