Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting a usb6008 cumulative count output to a speed measurement

Hi,
 
I am new to the data logging game so I would appeciate some assistance from some seasoned veterans 🙂  I have connected a speedometer to the PF10 and GND inputs to the USB 6008.  The speedometer generates a square wave who's frequency fluctuates as speed fluctuates.  I know the scaling factor (SF) between distance and number of pulses so with this I want to calculate 'instantaneous' speed in real time from the logger. 
 
So far I have managed to get SignalExpressLE to give me a cumulative count of falling edges of the square wave but there does not seem to be a way to manipulate this data in real time.  Does anyone know a way of linking the SignalExpressLE output to Excel in real time?
 
Alternatively I thought of using C# to talk directly to the DAQmx to perform the conversion.  My idea is as follows:
 
counter sample rate = 10Hz
'instantaneous' speed output = 1Hz
speed calculation = 'instantaneous' speed @ t + 1 sec = SF*((cumulative count at t + 2sec) - (cumulative count at tsec))
 
Can anyone direct me to some example code which performs a smilar operation?
 
Oh and one more thing - I'm using a digital input and 2 x analogue inputs at the same time as taking the speed measurement.  If I do use C# to talk to the DAQmx can I simultaneously use SignalExpressLE to process the other inputs or will have to do everything in C#?
 
Thanks,
 
James
0 Kudos
Message 1 of 2
(3,783 Views)

Hi James,

You can have another application using the DIO and AI lines at the same time as C# is using the counter as they don't use any of the same resources.

Are you looking for example code to set up a counter measurement with DAQmx in C#? You should be able to use one of the ones that gets installed with DAQmx. They're located at C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr.

Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 2 of 2
(3,742 Views)