11-16-2015 09:06 PM
Hi,
I am very new to labview and was wondering if it is possible to get myDAQ input to behave like a latching switch when it isn't physically a latching switch. I have a circuit consisting of a touch sensor that behaves like a pushbutton. This sensor sends input to the myDAQ when the wire is touched, and it outputs a signal to an LED (connected to a digital output pin on the myDAQ) to turn it on. I would like to use labview to take the signal produced when the sensor is touched to keep the LED on until the sensor is pressed again. RIght now, the LED only stays on while the sensor is being touched. Any suggestions?
Here is what the block diagram currently looks like:
11-16-2015 09:13 PM
The logic you have now is going to pass the value without maintaining history.
You're going to need a loop of some kind. I'll leave this to you to figure out.
You'll need to maintain history. I'd suggest a shift register. With this, you can compare the current value to the last.
Once you have that, you'll want to find a way to use the comparison to determine how to handle the LED.
11-17-2015 01:14 AM
Hi Catherine,
I would like to use labview to take the signal produced when the sensor is touched to keep the LED on until the sensor is pressed again.
To solve such porblems it (sometimes) helps to create some pseudocode:
IF (sensor_current == TRUE) AND (sensor_before == FALSE) /* detect "sensor is touched" */
THEN LED := NOT(LED) /* switch LED */ ENDIF
It really helps to work with pseudocode (or schematic flow diagrams) to analyze a problem. And analyzing a problem is usually the first step to write a program…