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: 

Case

Solved!
Go to solution

HI

 

I am trying to flick between 2 case statements and can not get it to work I have attached my Vi can someone please help me.

 

Best Regards

David

0 Kudos
Message 1 of 10
(3,486 Views)
Solution
Accepted by topic author DPJones

You've wired a constant 'Wait For Data' to the case selector, so it will always execute the same case.  You want to add a shift register to the while loop, move the 'Wait For Data' constant outside the loop, and wire the unconnected output of the case structure to the right-shift register terminal.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 10
(3,472 Views)

Hi Paul

 

I have changed the code as you suggested and it now works however I have a problem because it exits the while loop and closes my (CLOSE LJM Vi) which stops it working properly how can I resolve this?

 

Best Regards

David

 

0 Kudos
Message 3 of 10
(3,445 Views)
Solution
Accepted by topic author DPJones

The only way it exits the while loop is if you hit the stop button.

 

One problem I do see is that you have a blue wire that runs through the missing subVI's.  But where that wire exits the case structure, you have it set for "Use Default if Unwired" on that case tunnel.  That means you risk losing the data in the wire when that case structure ends.  You should uncheck that tunnel setting, and make sure it is wired through every case, even those that don't use it.

0 Kudos
Message 4 of 10
(3,438 Views)

Hi 

That has now cured the problem

many thanks

David

0 Kudos
Message 5 of 10
(3,424 Views)

So nice of you to mark your own reply as the solution to your problem when others here have clearly pointed you in the right direction.  In the future be sure and give credit to those that help you by giving kudos and marking their replies as solutions.

0 Kudos
Message 6 of 10
(3,415 Views)

Hi

 

I am sorry this has upset you so much please,  beware this is only my second posting and I am not sure how to use this forum yet, it was never my intention to take credit for anything perhaps you should be a bit more tolerant until you know all the facts

 

 

0 Kudos
Message 7 of 10
(3,411 Views)

You can go to the options menu of your message and pick "Unmark as Solution".  Then you can go to which ever message helped you the most and mark that as the solution.

 

You can mark multiple messages as solutions if you find they were particularly helpful to solving your problem.

0 Kudos
Message 8 of 10
(3,408 Views)

Hi

Thanks for your advise

I have looked at the options but I dont have (Unmark as Solution) in the option drop down?

0 Kudos
Message 9 of 10
(3,403 Views)
Solution
Accepted by topic author DPJones

The message that you marked as the solution.  Go to the Options menu to the upper right of that specific message.

0 Kudos
Message 10 of 10
(3,397 Views)