09-16-2019 04:15 AM
Hello,
Is there a reliable method to measure semi-period (time) of digital signal and its state (0 or 1)?
I am using Counter CI-SEMI-PERIOD but this gives me only a time. I am "controling" the state knowing only starting edge, but I am not confident my program will not desynchronize at some point. I would like to have information about state directly from mDAQ together with time..
Thanks in advance.
09-16-2019 11:02 AM
What DAQ device are you working with?
A semi-period measurement task should alternate between high and low times without desynchronizing. You would just need to keep track of odd vs even indices of the cumulative data.
Some newer devices support "Pulse" measurements which present the data in a structure that pairs the semi-periods more explicitly.
Another method might be to use DI with change detection (if your DAQ device supports it) if you only need digital state info rather than timing info.
-Kevin P
09-24-2019 02:48 AM - edited 09-24-2019 02:49 AM
I'm using USB-6343 (USB X-Series).
So far I'm using your first method. It seems to work I just don't feel much confident it won't desynchronize at some point during runtime.
Your second option looks nice but I havn't found it in my device. (?) Do you have any example of device supporting this option?
Third option is not for me. I need timing.
09-24-2019 10:17 AM
There are shipping examples for "Pulse" measurements, and your X-series device supports them. They're written for measuring frequency but you can slightly modify them so they'll measure high and low times instead.
I don't think there's a need to worry about desynchronizing during runtime, but you could always combine your counter measurement with a digital change detection task which can be used to confirm all the digital states directly.
-Kevin P