07-08-2014 10:07 AM
I am writing a program to run a syringe pump and the signals that I am receiving from the sensor testing the device the syringe pump is pumping liquid into is an intermittent signal for a fraction of a second. The signal flashes from there to not there and there again because it is being used as a wet dry sensor. I can not figure out how to make it ignore the intermittent signal and only go with the solid signals being received. The sensor is hooked up to a DAQ card and the outputs are read from that.
Solved! Go to Solution.
07-08-2014 11:20 AM - edited 07-08-2014 11:21 AM
@james92190 wrote:
I am writing a program to run a syringe pump and the signals that I am receiving from the sensor testing the device the syringe pump is pumping liquid into is an intermittent signal for a fraction of a second. The signal flashes from there to not there and there again because it is being used as a wet dry sensor. I can not figure out how to make it ignore the intermittent signal and only go with the solid signals being received. The sensor is hooked up to a DAQ card and the outputs are read from that.
Your description is not very clear. What I understood from your explanation is it looks like you need a persistance time. The Persistance time depends on the time you define to ensure that the signal is solid (may be 100 ms or 1000ms). So when you get the signal start a timer and check how long the signal is in the same state (If it is Boolean its just checking how long the signal stays in High/Low state). If it changes then reset the timer and if it is not changing within the time you specify then that is the solid signal you are looking for.
General information: This persistance timer is more useful when you design a monitoring system where you will be monitoring lot of signals. I those cases you may have to avoid spikes due to noise and the persistance timer plays a significant role.