Measure

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency measurement using Measure 2.0

I would like to measure the frequency of a 5Volt square wave coming from a Hall Effect Sensor. I'm told that a way to do this is to use the Excel VBA to call a DLL which can control the Multifunction DAQ counters used to compute frequency. But I am not sure how to piece this together. I'v attached some VB code I found on the NI website that initializes the counters. What I need is a method of turning that file into a DLL and then I need to know how to call it from Excel VBA. This is the last part of my Senior Project at CalPoly, SLO and any help would be greatly appreciated.
Thanks
James
0 Kudos
Message 1 of 2
(6,712 Views)
A simple solution is to create a Do-Loop that will index through a list of samples counting the number of rising edges (ie a 0-5Volt change). Knowing the number of rising edges, the number of pulses possible per revolution, and the sample duration the frequency can be calculated. The code takes awhile to run since it must index through all of the acquired data so the less sample the faster the frequency calculation, but the fewer sample the lower the resolution.
James
0 Kudos
Message 2 of 2
(6,712 Views)