02-26-2015 06:32 AM
Hi,
I am acquiring a digital input through my 9401 module., using simple DAQmx Read polymorphic VI
The pin is called ERROR OUT Pin ; as whenever any error occurs that digital pin goes HIGH and when it is deactivated it goes LOW.
I want to calculate the time difference between these two events i.e.From Setting pin HIGH to going LOW .
Is it possible to calculate such difference by polling the same pin every 10ms? and how?
At the same time on detection of this Transition my VI execution should be stopped.
Currently, I am aborting my VI by using STOP button , which otherwise should be a triggered stop on detection of transition.
Please find my VI attached herewith.
Any help would be highly appreciated.
Best Regards,
Snehal Upadhye
02-26-2015 06:46 AM - edited 02-26-2015 06:46 AM
There is a function called Boolean Crossing Pt By Pt.vi that would be very useful to you here. It can detect if your booean value changed. So I would use that to detect when the line changes and store the time in a shift register. When the line goes back low, subtract the saved time from the current time and you will have your pulse length. You can also add a little more logic to stop your loop when the pulse goes back low.
This snippet shows you how to stop your loop on the falling edge. See what you can do from here to get your pulse length.
02-26-2015 07:46 AM
Hi Crossrulz,
Thanks for the suggestion. I'll try this out.
So I would use that to detect when the line changes and store the time in a shift register
How would I do that?
I am not that familiar with Timing functions.
Best Regards,
Snehal Upadhye
02-26-2015
07:50 AM
- last edited on
05-01-2025
10:11 AM
by
Content Cleaner
@SuLAB wrote:
How would I do that?
http://www.ni.com/getting-started/labview-basics/shift-registers
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-26-2015 07:58 AM
Thanks Hooovahh for the reply.
But I know the concept of shift register.
I said I am not familiar with "Timing" functions; hence I don't know how to store a Timestamp of a particular event in the shift register.
Which timing function can be used and how, is my concern.
Regards,
Snehal Upadye
02-26-2015 08:11 AM
I didn't know about the Boolean Crossing VI. Kudos!
02-26-2015 08:51 AM
@SuLAB wrote:
Thanks Hooovahh for the reply.
But I know the concept of shift register.
I said I am not familiar with "Timing" functions; hence I don't know how to store a Timestamp of a particular event in the shift register.
Which timing function can be used and how, is my concern.
Regards,
Snehal Upadye
You wire a timestamp into a shift register just like you'd wire any other datatype.
This thread really belongs in the LabVIEW forum, not breakpoint.