NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Member
smoothdurban
Posts: 173
0 Kudos
Accepted Solution

Timed Switch between 3 Cases and Back!

Hello,

 

I am trying to determine how I can switch between three cases in a case structure allowing a certain time between each switch.

 

For example: say I have three cases in a case structure (Cases {0,1,2}) where zero is the default case.

 

What I would to do is start in the default case 0 wait 1 sec, switch to case 1, wait 1 sec switch to case 2, wait 1 sec switch back to case 1, wait 1 second switch back to case 0.  Then repeat the order.

 

I was using the timer elapsed value from the Ramp Tim function to switch a select function between true and false but with the additional case I don't think this approach will work.

 

Any ideas?

Tim Z
Test Engineer
Magna International
Knight of NI
Knight of NI
Ben
Posts: 16,133
0 Kudos

Re: Timed Switch between 3 Cases and Back!

Search for the term "State Machine". It is what you re trying to invent (nice work) so feel free to "Cheat" and look for the wheel as it exists now.

 

Ben

Ben Rayner
Who is NOT John Galt... yet... just building Rayner's Ridge
Scheduled to close on the new ridge next week!
Member
smoothdurban
Posts: 173
0 Kudos

Re: Timed Switch between 3 Cases and Back!

Thanks a bunch.  I have been able to perofmr this simple task and have the possibly to complete much more complicated ones!

Tim Z
Test Engineer
Magna International