From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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 repeatting

Hello everbody:
Would you please help me out with my VI code. I try to make a case loop. I have 5 cases. Case 0, Case 1, Case 2, Case 3, Case 4, and Case 5. I try to make a loop:
Case 0 -->>Case 1-->>Case 2-->>Case 3-->>Case 4-->>Case 5-->>Case 0
 
Would you please correct my VI code?
 
Thank you very much for your help.
 
Best regards,
 
Brian
0 Kudos
Message 1 of 7
(2,730 Views)

Hi Brian ,

 

Here is the modified vi for yoy.Hope it solves your purpose.

Keep things as simple as possible.

Best Wishes !

sarita

0 Kudos
Message 2 of 7
(2,722 Views)

You just need the Quotient & Remainder function to do it. Don't understand the purpose of the controls though so I just had the indicators cycle to represent which case has executed

I agree that things should be made simple.Smiley Wink

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

Since you are using LabVIEW 8.0, you won't be able to look at the two modifications posted above.

Here is my suggestion that goes even a bit further (no case structure).

  1. Use arrays instead of indvidual indicators.
  2. Initialize an array of five FALSE elements, then cycle throuch each, replacing with TRUE depending on position.
  3. I agree with Dennis that your control does not make a lot of sense.
  4. If you need a case for other code, simply tap into the wire going to "numeric"

 

Message Edited by altenbach on 05-05-2007 10:35 AM

Download All
0 Kudos
Message 4 of 7
(2,710 Views)

Hi Dennis,

 

Your modification is really cool...but it is not repeating the case values,if you think over that aprt also,may be yours can be best n easy solution for this problem.

 

Regards !

Sarita Smiley Tongue

0 Kudos
Message 5 of 7
(2,665 Views)
It will not repeat any cases if the 'Cases' knob is set to 0. It just keeps calling case 5 - the default case.
0 Kudos
Message 6 of 7
(2,650 Views)


@Dennis Knutson wrote:
It will not repeat any cases if the 'Cases' knob is set to 0. It just keeps calling case 5 - the default case.

MindPower
Also, if you want to be able to change the "Cases" knob during run, place the control terminal inside the while loop. (see also my example).
0 Kudos
Message 7 of 7
(2,640 Views)