LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TWO ENUM ONE LV

I think it is easier with the nested structures, because this behaves how labview1958 wants it to. The motor is just controlled if the readings-enum is set to MOTOR.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 11 of 17
(1,264 Views)
Does it mean I have TWO separate vi's in the block diagram. Then I have an enum that select the VI instead of the case structure? Like an enum selecting between two sub vi's?
0 Kudos
Message 12 of 17
(1,295 Views)
NO! Now you're mixing two things up.
 
I just thought it would be helpful for you, if you can see the dataflow and how the structures are executed.
 
I attach you a simple vi (LV7.0), which has two nested structures (as your vi has). In the structures is a string-constant which is written to a control. So open the vi and play with it. Change the enum values and look (in highlighting mode) which case is executed.
 
I hope this helps you to understand what I mean.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 13 of 17
(1,261 Views)
Thanks. It seems both the enums are executed. Only one enum is executed earlier than the other. Is it possible to execute just  ONE enum only . The other enum can just be silent and don't move?
0 Kudos
Message 14 of 17
(1,257 Views)
Why?
 
There is just the possibility left, that the enum, which controls the inner structure, is moved into the outer structure. Then it is just executed if the case it is place in executes.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 15 of 17
(1,254 Views)
You are a genious. I have understood. I have redone the vi. I have pasted it here. I hope it is correct.
0 Kudos
Message 16 of 17
(1,249 Views)
You should learn about case structure basics.  Only the case that is selected will run, all other cases will NOT run.  That is the purpose of a case structure.  It is like an If-Else statement in text based languages.  Only the If or only the Else executes, never both.  Your vi as you have it now will work fine.  When you select Readings, that case will execute and it does not matter what your other enum is because it is not used in the Readings case.  When you select Motor, the Motor case will execute and it uses the other enum to determine which inner case to execute, Forward or Reverse.  When running this case, the Readings case will not execute.  Turn on highlite execution (the light bulb) and then run your vi.  You will see how it executes.
- tbob

Inventor of the WORM Global
Message 17 of 17
(1,230 Views)