LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure

Hello Professionals, I am new to LabView. I would like to make a case structure in the LabView with the NXT robot project. I try to use Case structure. But I dont see a way to change the case value. For example

I would like the robot wheels to move in forward direction, untill the distance arrived by the Ultrasonic sensor close to 25 . Once it reaches I would like the wheels to move in backward drection untill Ultrasonic distance is 45. Again I want to move to the next case value say 60 . Can any one give a solution. Here with I attach you the VI. 

0 Kudos
Message 1 of 13
(5,237 Views)

Hello Professionals, I am new to LabView. I would like to make a case structure in the LabView with the NXT robot project. I try to use Case structure. But I dont see a way to change the case value. For example

I would like the robot wheels to move in forward direction, untill the distance arrived by the Ultrasonic sensor close to 25 . Once it reaches I would like the wheels to move in backward drection untill Ultrasonic distance is 45. Again I want to move to the next case value say 60 . Can any one give a solution. Here with I attach you the VI. 

Download All
0 Kudos
Message 2 of 13
(5,253 Views)

Think about your problem.  You want to do "something" until "some condition is reached", at which point you want to do "something else" (and so on).  To my mind, the natural "case" is "What am I doing?".  Within each Case, there is (a) a different "thing to do" (i.e. Move Forward or Move Backward) and (b) a different "time to do something else" (i.e. "Distance < 25" or "Distance > 40".

 

Things that have separate States with a rule of what happens during a State and what causes the State to change is called ... a State Machine.  If you are brand new to LabVIEW, some of the concepts behind the State Machine might stretch your mind a bit (but that's not too bad ...).

 

If you start LabVIEW and choose Create Project, one of the Example Projects should be Simple State Machine.  Look it over, read the documentation, and ask questions if there are still things you don't understand.

 

Bob Schor

Message 3 of 13
(5,224 Views)

Hi,

 

welcome to LabVIEW. Please visit a Training or do the self paced online training. LabVEIW is very intuitive and easy to use, but there is a certain amount of rules to follow and concepts to know, to make everything work. You will not regret it in the long run.

0 Kudos
Message 4 of 13
(5,160 Views)

here is an awesome example for you, press run and wait till it counts to 25

0 Kudos
Message 5 of 13
(5,156 Views)

Hello Gregor,

       Thank you. I just have Labview 2012. Your version seems to be higher. Can you save it to the lower version, so that I will  be able ot access it.  Looking forward to hear from you. 

 

With regards

John4u

0 Kudos
Message 7 of 13
(5,117 Views)
Message 8 of 13
(5,094 Views)

Thank you Gregor, I am able to make a step further. It is very useful. 

 

Regards

John4u

 

0 Kudos
Message 9 of 13
(5,058 Views)

Hello Gregor,

         I tried to create a similar one as you sent. But I am not getting the same result. In the forward case it goes to +1 and again gets back to 0. Can you or any one here tell me where the correction has to be made. Here with I attach you the file. Thank you.

 

Regards

John4u

0 Kudos
Message 10 of 13
(4,985 Views)