LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TWO ENUM ONE LV

I have two enums in my LV. I want to RUN only one enum. How do I do that? I also have errors like select tunnel: missing assignment to tunnel. What shall I do? Thanks.
 
The LV in 6.0 is attached.
0 Kudos
Message 1 of 17
(3,678 Views)

I'm not sure what you mean by running an enum, but to fix the errors is easy. When a wore passes through the wall of a case structure you have to define an output value for every case in the structure. So you have two choices, define values for the other case OR move the indicators and the subvi inside the case structure (which look like is the one you would want to do). See attached screenshot...

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 17
(3,676 Views)
I have two enums. One select the motor for FORWARD or REVERSE movement. The other selects whether to take READINGS or not. I do not want the motor to move while the readings are being taken. Which enum selection the LV will run, the motor direction or take the readings selection. Is it possible to combine the two enums into one?
0 Kudos
Message 3 of 17
(3,672 Views)

There is no problem to make one enum with all you values, but I would not do it.

The program is more readable if you have different enums which concentrate on one "topic" (just an example: Enum "MotorControl" / Values Forward, Reverse, Stop). I think this is much better than to have one enum conataining all values (e.g. Enum "General" / Values Forward, Reverse, Stop, Read, No Read).

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 17
(3,668 Views)
If there are TWO enums, how does LV knows which selection to execute?
0 Kudos
Message 5 of 17
(3,666 Views)
How do you mean that? Do you want to connect two enums to one case-structure?
 
This won't work. You will have to put one case-structure into another.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 6 of 17
(3,665 Views)
I have already put one case structure into another. I still have two ENUMS. When I select something from ENUM A and not from ENUM B, how does LV execute. My selection from enum A or from enum B or BOTH? The vi is attached in LV6.0
0 Kudos
Message 7 of 17
(3,659 Views)
Sorry. The vi is now attached.
0 Kudos
Message 8 of 17
(3,660 Views)
It is executed as you wired it. Each time your vi runs the cases are executed depending on the values.
 
The inner case structure just executes, if you select "MOTOR" of enum "Readings". If you select "READINGS", the readings-case is executed.
 
I'd suggest you to simpli build the case-structures with the enums in another vi, execute it in highlighting mode and observe what happens in which case.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 9 of 17
(3,656 Views)
Hello labview1958,

LabView is dataflow based:
So it will run your vi from the outer case to the inner. This way first the enum "Readings" will be checked (outer case structure), then enum "Motor direction" (inner case structure). But you cannot change "Motor dir" after "Readings" has been read as you both wired them from outside the outer case (dataflow!). And "Motor dir"/inner case structure will only be processed if "Readings" is set to "Motor".

So maybe you have to changed your vi to:
1) move the communication part into subvi's (moving motor, reading data)
3) do motor moving and reading in parallel loops
2) check "Readings": if set to "Reading" then stop motor moving (in parallel loop), do reading, start motor moving again

Hope this helps.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 17
(3,623 Views)