This has nothing to do with creating an executable. This has everything to do with race conditions.
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.