06-06-2016 08:28 AM - edited 06-06-2016 08:31 AM
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:
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
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
06-06-2016 12:20 PM
Well, like most things in life, after asking I figured out the solution (attached below). HOWEVER, I am still plagued trying to get this timed value out of the loop->if->loop statements and graphed. Is there an easier way to do this?