LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help to Stop System Stop Button on my state machine

Solved!
Go to solution

Hello,

 

Can anyone help me to please figure out why my stop button can't stop the state machine, I want to stop the program even the program is running.. and it's sad to say for my side that, when i pressed the Stop Button it will only stop until the loop is done. and What I really want is to stop it even the loop is running. I've attached here my vi for your refference..

 

Thank you and Best regards,

syrpimp

State Machine

 

 

 

 

Front Panel

 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 1 of 17
(4,243 Views)

Hi,

 

you need to read the stop button either in each state or just after the states. Reading it only in the setup state will not work…

 

Hiding event structures in cases will also force errors!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(4,237 Views)

Thanks GerdW, but how to set it up?

 

 

Thank you and Best regards,

syrpimp



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 3 of 17
(4,235 Views)

Who is Gerard?

 

You need to read your stop button after the states: outside the case structure!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(4,231 Views)

I'am sorry, I already tried that, but it can't help me. I pulled out the stop button and connect it directly to the contitional terminal but the for loop continue to run..

 

Thank you and Best regards,

syrpimp



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 5 of 17
(4,226 Views)

Hi syrpimp,

 

you can use a Select function with STOP as condition: IF stop THEN "Exit" ELSE "next state"

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(4,219 Views)

Would you mind if you can show me a simple code for that..

 

because i try somthing like this in my program and nothing happened.

 

ScreenHunter_27 Aug. 27 16.57.jpg

 

Thank you and Best regards,

syrpimp



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 7 of 17
(4,214 Views)

Hi syrpimp,

 

something like this:

check.png

Depending on conditions I choose the next state. Replace those conditions with your STOP button…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(4,210 Views)

I've already tried that, and once you click the stop button, The program will let the loop to finished  first and then Stop, I want is When you click the Stop Button It should Stop Instantly. I'am sorry I was just confused

 

Thank you & Best regards,

syrpimp



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 9 of 17
(4,198 Views)

Hi syrpimp,

 

you cannot stop a loop instantly - you have to stop all the function it contains! THINK DATAFLOW!

 

So you need to check your stop condition in all states and in all loops embedded in those states to allow an emergency exit…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(4,193 Views)