05-09-2013 08:57 PM
I acquire the pulse response from a Parallax Distance Sensor, but I I don't know how to measure the number of thicks that this signal is high (the time the input signal is high is proportional to the distance). I'd like to reset the thick count when this signal is low. is this possible? Is there another option?
Thanks...
Solved! Go to Solution.
05-09-2013 09:15 PM
What is a "thick"?
05-09-2013 09:21 PM
Sorry, I mean Tick, lol
05-09-2013 09:28 PM
When the boolean is false, put the tick count into a shift register. When it is true, don't but it into the shift register but subtract the new tick count from the value in the shift register.
05-09-2013 11:32 PM - edited 05-09-2013 11:36 PM
Here is pretty much what Raven's said. This VI won't continously show the count though. It will only show the total time it was high, once the line goes back to low from high. You will have to adjust some if you want an indicator updating continously. The false case you can't see just has the wires wired straight through.
This could also be a bit more complex than it needs to be, I just threw it together quickly with the first thing that came to mind.
05-10-2013 02:25 AM - edited 05-10-2013 02:26 AM
@for(imstuck) wrote:
You will have to adjust some if you want an indicator updating continously.
Here's a very minimalistic version that updates the timer continuously while the switch is on and holds the last value when the switch is off. Try it!
05-10-2013 11:10 AM
I'm so sorry, I think I forgot to say that some data type and functional blocks are not available for FPGA Module. I cannot use double, neither HIgh Resolution Relative Seconds. I can just use the Tick Count Wait and Loop Timer. Also, thank you for replying my message so fast and create the Vi for me.
05-10-2013 11:32 AM
I'm so sorry, I think I forgot to say that some data type and functional blocks are not available for FPGA Module. I cannot use double, neither HIgh Resolution Relative Seconds. I can just use the Tick Count Wait and Loop Timer. Also, thank you for replying my message so fast and create the Vi for me.
05-10-2013 11:41 AM
05-10-2013 12:07 PM
I'm so sorry, I think I forgot to say that some data type and functional blocks are not available for FPGA Module. I cannot use double, neither HIgh Resolution Relative Seconds. I can just use the Tick Count Wait and Loop Timer. Also, thank you for replying my message so fast and create the Vi for me.