Hi Everyone,
A few months ago I wrote some code that records the current over time. It measures the current every 1s, and it gives the user the option to specify how often the data should be coded. It can be either linearly (for example, every minute), or logarithmically (small increments in the bigger leading up to a larger value and the user can specify the maximum sample intervals). I also created a queue that will record the "last minutes". For example, if the user wants to see what happened in the last minute, he will have every second recorded and that data will be appended the end of the file.
However, it was a messy piece of code (although working), and I wanted to clean it up so that it would be easier to add to in the future. I started to learn about state machines. I am building it slowly. First the user pushes play, and then fill in where to save, maximum recording intervals, other variables etc. and click load. After, the user can push play to start the program. At the moment, it is not connected to any equipment, just wanted to get the time recording intervals working.
At the moment, if it is run in debug mode, everything runs fine, but if it is not in debug mode, it stops after a few intervals. I think that is most likely a race condition. I do have some local variables, and I read that they should only be used if there are being used in two places within the same VI. But I don't think I am using them in the subVIs.
Can anyone give me some advice please? It looks like it is not updating to the next recording interval. I have attached my code.