LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switch case like C

Solved!
Go to solution

Yes it is but this is solved now so post it as other question with VI what you have tried so far

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 11 of 14
(563 Views)

@Ranjeet_Singh wrote:

Here


This seems overly complicated and convoluted.

 

  1. Why is the stop button set to "switch action"? Make it "latch action" and place the terminal inside the event case so it correctly resets when pressed. No need for local variables.
  2. Your cases 1,2,3,4 all contain the same code and they can be combined into one case (1..4)
  3. Why does it say "number 0 is pressed" if the input is out of range. That seems misleading.
  4. Why is the front panel maximised to the screen?
0 Kudos
Message 12 of 14
(531 Views)

@Ranjeet_Singh wrote:

Use event structure


NO! Events are for user interaction!

 

In the description here, the value is generated by a process, not by a front panel interaction.

 

All that's needed is a case structure, one for each case, each containing the code for the specified task. Wire the numeric to the case selector.

 

 

0 Kudos
Message 13 of 14
(529 Views)

@Omi_30 wrote:

Thanks a lot for the solution. Also is it possible to automate button pressing, suppose I am having one button but insted of user pressing that,can I controll the Button inside, using one Boolean?


A boolean implies that you only have two cases, so you can wire the boolean directly to the case structure.

 

Please be more specific where the selector value comes from. The word "process" is a big vague. A state machine has been mentioned several times here and that's what you should do. Can you show us your VI so we get a better idea what you are actually trying to do? Thanks!

0 Kudos
Message 14 of 14
(524 Views)