From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State machine won't stop

Solved!
Go to solution

Hi,

 

I am using a state machine to increase temperature by changing resistance. I am using labview 8 and the libraries for the controller I'm using won't work so I am writing the commands. Each different state sets a different temperature. In the last state I have a stop if true button but when I run my program it doesn't stop after the last case. I have attached my program. Sorry about how messy and unorganised it is. I have been trying different ways to fix it and it's a bit all over the place.

Thanks.

0 Kudos
Message 1 of 24
(2,846 Views)

Do you know if it even gets to state 20?

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 24
(2,843 Views)

Hi,

 

Yeah it goes through all the states doing exactly what it's supposed to but after state 20 it returns to state 0.

0 Kudos
Message 3 of 24
(2,832 Views)

Returns to state 0 and repeats the process I should have said

0 Kudos
Message 4 of 24
(2,822 Views)

I dunno - works for me.

 

How did you confirm that it did go to 20 and start over?

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 5 of 24
(2,816 Views)

Oh it worked for you? That's strange. I used highlight executuion and then I'm saving to a spreadsheet each iteration so there should just be 8 files but it just kept on running for me today. Is the way I am using the shift registers correct? (new to labview) I have a previous version where I hadn't started using them yet and it still works.

0 Kudos
Message 6 of 24
(2,812 Views)

I know what your problem is.  The way you have it set up, every iteration between 6 and 20 will use the "0, default" case, making it do more reports than you were expecting.  Because you had so many long waits, you probably thought it was repeating itself.  To avoid this, make an empty case for that range.

 

Don't forget to wire the empty case wires all the way through..

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 7 of 24
(2,804 Views)

Oh I see. So could I delete case 20 and make a case 7?

0 Kudos
Message 8 of 24
(2,794 Views)
Solution
Accepted by topic author pagz

@pagz wrote:

Oh I see. So could I delete case 20 and make a case 7?


Well, don't delete it.  Just rename it to 7.  🙂

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 9 of 24
(2,791 Views)

Hey, it's NOT BAD for a new LabVIEW programmer.  If you could look around the NI Site and do some of the tutorials, you will see how to clean up your code and learn best practices.  🙂

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 10 of 24
(2,785 Views)