Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2167

Measuring Two Line "Pulse" Width Using Digital Input Lines

$
0
0

Hey all,

 

     I am trying to measure the time difference of two digital IO signals that annunciate the opened/closed state of a valve using digital lines.  Attached is my code and a couple pictures of what I have working so far.

 

I am left with:  

A) Measuring the time between when the first signal line goes high and when the second signal line goes low (time between CLOSED turning off and OPENED turning on and vice - versa).  

B) Alternatively, I can measure the time when signal OPEN gets asserted, and signal OPENED gets actuated (and vice - versa)

 

Below is code for all three loops.  Also below is the pseudo for what I am doing:

  1. I have the actuation working in labview, loop 1.  
  2. ???MEASURE TIME DIFFERENCE???
  3. And I have the annunciation of the two signals displayed on the Labview screen, loop 3.

I am using the USB-6525 and thus I only have one counter to work with and I WOULD LIKE to use the two digital input lines I am currently using  

  • the approximate time of open -> close is 2 to 10 seconds
  • The resolution needed is around 50ms
  • The signals are NOT periodic thus I cannot use the waveform measurement.
  • Open/Close actuation are both synchronous with respect to each other but the OPENED/CLOSED actuation are not. 

Let me know if you have any questions regarding my problem.  I feel like this should be a simple solution using the get_ms timer function and while loops to update the value until the signal changes (stopping the loop counter), but I don't know...

 

Sincerely,

Nicholas

CycleTest 1.PNG

CycleTest 2.PNG


Viewing all articles
Browse latest Browse all 2167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>