LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a voltage output based on an ultrasonic sensor input

For a school project we are trying to use an ultrasonic sensor to control the voltage sent to a group of leds. We calibrated the sensor and determined six different voltage levels that we wished to output to the leds based on the voltage input to the sensor. We set up a labview program and were going use one of the mathnodes that allows code to be written to send a signal to a case structure to send the output voltage. Each case has a different output voltage associated with it. We can't seem to get the math node to work with the case structure to get an output. I have attached a screen shot of our block diagram and a copy of our .vi file. If anyone has any input it would be appreciated.

Download All
0 Kudos
Message 1 of 2
(2,626 Views)

Hello,

 

Have you used highlight execution or probes to confirm the output of the Mathscript node? Also, though LabVIEW is coercing your output, it is not best practice to wire a double (floating point) to a case structure (discrete cases). I would recommend changing the data type to an integer.

 

Please let me know the results of the probe steps.

 

Thank You, 

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

0 Kudos
Message 2 of 2
(2,598 Views)