08-13-2014 02:31 AM
08-13-2014 07:39 AM
Hi Maurlind!
I have had a look at your VI and I made some changes to it so that you can "restart it". With stop recording button you do just that stopping the recording. With the New test button you reset and restart your main loop/program. Save and tare I didn't tough.
I made some cleaning up to be able to understand your code and what was done where. Some code might have been unnecessary I let you go over the logics and clean further. I put all your analyzing code in the event structure into a SUBvi to make it easier to read. I attach this subVI as well. (You can easily do this your self by selecting part of code you want to be in a subVI then go to the LabVIEW meny and EDIT>>create subvi)
I would also suggest as many others already have done to write down the states and functionality your program needs before coding and then using a standardised template and code after that. I would suggest a event based statemachine which is part of LabVIEW and you can learn more about it in the Core 1 course which is available to all customers of LabVIEW with active software service agreement. Which also entitels you to support from NI.
I've commented the code where I did changes and you will find it attached. I'm not sure if it does exactly what you want and this is just an example how to do it. You have to make sure the code works as intended before it is released as EXE.
Best regards
Jonas