LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting conditions for loops

Hi,

I am very new to Labview and need to produce a program to do the following. I am building an ultrasonic distance measurement sensor which is mounted on top of a remote control car. I need to control the car motors so that I can move back or forward depending on the distance measurement. Right now I need to write a program so that I can turn off and on the motors depending on a numeric condition: e.g.. if x<=10, motor off, else motor on. I have a basic knowledge of matlab so I am familiar with loops. I need to use something like an "if" loop but all I have done in Labview so far is o/p, i/p of analogue and digital signals. I have a DAQ-USB-6008, and a relay wired to analogue o/p. I can control the on off of the motor with numeric controls no problem but I would like a way of setting a condition. Any help or even where to find relative information would be appreciated.           

0 Kudos
Message 1 of 2
(1,965 Views)

Hi gary,

 

you don't use loops to check conditions, but need case structures instead...

 

When you just have to states (on and off) you may simplify the case structure with a select node from the comparison functions palette!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(1,946 Views)