LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running a case inside another case.

I have made an LV in 6.0. It is attached. The lead VI is the MAIN.VI. I want to run the DOWN case which is inside the MOTOR case. I can choose that case from the CHOICES. When I do that, I only manage to run the INFORMATION Default case. How do I rectify that with min imal change to my vi? I hate to overhaul my LV just because of this minor problem . I hope someone cah help.
0 Kudos
Message 1 of 9
(3,233 Views)

It is very unusual to have a main, toplevel VI without any while loop around it. How are you running this? Are you using the "continuous run" mode???

Can you explain why you cannot select the motor case? Seems to work OK here. Could you clarify your problem in a few more sentences?

Message 2 of 9
(3,229 Views)
I am trying to RUN in the RUN mode. However I can only manage to run the INFORMATION, default. For some unknown reason, only the information default works. Nothing seems to work unless I make that particular frame, default. Is there a way out. I intend to RUN only the "Information, default" case + "DOWN" case in the "MOTOR" case. Instead only the Information. default case runs only.
0 Kudos
Message 3 of 9
(3,216 Views)
OK, I see the problem.
 
  1. Your big case structure does not have cases for up and down, thus if these items occur, the default case is executed.
  2. Your inner case only executes if MOTOR is selected, at which time neither UP nor DOWN can occur.
  3. You need to change the MOTOR case so it also triggers if either UP or DOWN is selected. Just go to the MOTOR case, and also enter "UP" and "DOWN" after "MOTOR", all separated by commas. THe current MOTOR case should look similar to ["MOTOR".."DOWN"] or ["MOTOR","UP","DOWN"]. (I no longer have LabVIEW 6.0, so it might look a bit different.)

Of course you don't really need the MOTOR event al all, since it is always either up or down. You could eliminate it and just use "UP","DOWN" in the outer case. 😉

Message 4 of 9
(3,210 Views)
I have modified my LV in 6.0. It now works nicely. However I have now two UP's. If I try to change one UP to something else, the program misbehaves. It goes into default and I cannot run any UP. Hope can help. The new lv in 6.0 is attached.
0 Kudos
Message 5 of 9
(3,179 Views)


@labview1958 wrote:
I have modified my LV in 6.0. It now works nicely. However I have now two UP's. If I try to change one UP to something else, the program misbehaves. It goes into default and I cannot run any UP. Hope can help. The new lv in 6.0 is attached.

I don't understand what you are saying. There is only one UP but two case statements that read it. If the program works nicely you're all set! 🙂
 
(No need to break it by changing UP to something else. Why would you do that???)
 
Please only attach your Main VI in the future. You don't need to include all the VI lib files. Keep the attachment small.
Message 6 of 9
(3,159 Views)

Does changing the "outer" "UP,default" case to just default make a difference? It should then execute with UP, Down or any of the other ones that are in the inner case.

 

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 7 of 9
(3,157 Views)
How to send only the MAIN.VI without the .lib files on the forum? How to use JPG? Is JPG a free software?
0 Kudos
Message 8 of 9
(3,133 Views)

You can just save it as VI, then attach it.

JPG is just an image format. Any graphics software should be able to save an image as JPG that you can attach/ For VIs, GIF or PNG are preferable. JPG is more for photographs and does not deal well with images containing lines and sharp edges (such as a VI diagram)..

Message 9 of 9
(3,127 Views)