From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I extract only the rising edge (or falling edge) of a pulse train, in order to determine average velocity?

I have a pulse train 0~4 volts from a Hall effect sensor. How do I extract only the rising edge (or falling egde), in order to determine average velocity? Need to write an autosequence for this. 
 
I've attached the diadem data as reference. I'm interested to get the velocity between 0.06s and 0.07s.
 
Thanks in advance.
0 Kudos
Message 1 of 3
(3,502 Views)

Rizal,

I'm not exactly sure, but I'm guessing that you want to get the time (and thus velocity) to get from the each min to the corresponding Max.  If this is the case, you can use the Peak Search to find the mins and maxes and subtract the time values of each of these items.  To do this in the script, you would use the method:

Call CHNPEAKFIND(1,2,"/X_Peak_Min","/Y_Peak_Min",15,"Min.Peaks","Time")
Call CHNPEAKFIND(1,2,"/X_Peak_Max","/Y_Peak_Max",15,"Max.Peaks","Time")

Once you call these 2 commands, you'll have 2 sets of channels that you'll be able to look through with all the mins and maxes within your data.  You could then loop through this and find the velocities at different points.

As I said, I'm not sure if I made the correct assumptions for exactly what you are looking for, so if you're looking for something different, please let me know and I'll get that answer for you as well.  Thanks and have a great day.

 

0 Kudos
Message 2 of 3
(3,487 Views)

Hi Rizal,

Actually there's a DIAdem VBScript example on the NI web that does this TTL to RPM conversion as well as Joint-Time-Frequency Analysis and Order Analysis.

http://zone.ni.com/devzone/conceptd.nsf/webmain/02A26930078B268986256E9000618BD7?opendocument

It wouldn't be too hard to rip out just the TTL to RPM conversion VBScript and use that in isolation for your purposes, or you could also just use this example as-is, if you're happy running it interactively.
 
Let us know if you need additional assistence,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,438 Views)