LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Machine Lost State

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!

0 Kudos
Message 1 of 10
(2,738 Views)

Can you share the code with us?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 10
(2,728 Views)

Solved!

0 Kudos
Message 3 of 10
(2,718 Views)

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?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 10
(2,697 Views)

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.

Message 5 of 10
(2,686 Views)

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.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 10
(2,678 Views)

🙂

0 Kudos
Message 7 of 10
(2,667 Views)

I still don't get it. Why was there a FOR loop to begin with if it can be removed without problems?

0 Kudos
Message 8 of 10
(2,661 Views)

You should see the whole project to understand.

0 Kudos
Message 9 of 10
(2,635 Views)

Well, I don't see it, that's why I don't understand. 😄

0 Kudos
Message 10 of 10
(2,628 Views)