01-25-2014 05:04 AM
Hello!
I have a producer/consumer pattern mixed with state machine in the consumer. I'm saving data to TDMS file with that structure. I would like to add a button, which would go to a state New File, to close the current file and continue saving into a new one. I created the state, in which I close the previous file, and try to open a new one, but when I click on the button nothing happens. The strange thing is, when I press the button the new state shows at the END of the while loop (in the shift register), but after it goes to the NEXT new iteration, the shift register has the old state in it, so that I miss the new state.
What do I do wrong? Where should I place the button, to make the state change?
Thank you in advance!
01-25-2014 05:28 AM
Can you share the code with us?
01-25-2014 06:50 AM
Solved!
01-25-2014 12:07 PM
Since this is a leanring forum also, could you elaborate on what you did so that those facing similar problems might benefit from your knowledge?
01-25-2014 12:39 PM
The whole thing was in a FOR loop, that I forget to mention, so that the new state couldn't come. I recreated the code without the loop, and then worked.
01-25-2014 12:59 PM
Great, thanks for the answer. Sometimes you think you are travelling the path alone when there are people staring at your post right now and the light buld just lit. 🙂
01-25-2014 03:00 PM
🙂
01-25-2014 03:24 PM
I still don't get it. Why was there a FOR loop to begin with if it can be removed without problems?
01-26-2014 01:50 AM
You should see the whole project to understand.
01-26-2014 01:59 AM
Well, I don't see it, that's why I don't understand. 😄