LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to assign time stamps to counter input data?

Compact DAQ

NI 9411

 

Hi Everyone,

 

I am creating a chart recorder for collecting various engine data.  I need to plot engine speed, crank angle, and various analog data on an XY graph.  I am using a counter and a mag pickup to continuously measure the frequency of the flywheel teeth.  From this data I create an array of timestamps based on accumulated periods for each frequency measurement.  My problem is, how do I determine the absolute timestamp for the first frequency of the buffered data?  I need to sync the frequency data with the analog data so I can plot it all vs time on an XY graph.  The flywheel has 201 teeth and the engine runs at 600 RPM.

 

I am using a second mag pickup and counter to measure a single index pulse on the flywheel.  This will be used to determine the crank angle.  I also need to create a timestamp for each index pulse.  What is the best way to do this?

 

Is it possible to treat the two mag pickups as an encoder and not use the B phase (direction) pulse? 

 

I am fairly new to LabView and any help would be greatly appreciated.

 

Thanks in advance,

 

Kris

0 Kudos
Message 1 of 4
(4,028 Views)

Hi Kris,

 

With analog and digital input tasks in DAQmx, it is possible to acquire data of the type 'waveform'.This includes timestamp information for the acquired data. This example is a good one to reference to understand how this is done: http://decibel.ni.com/content/docs/DOC-3749

With counter tasks in DAQmx, however, your best bet would be to use the 'Get Date/Time in Seconds' VI to obtain the absolute time. You can set this up so that the absolute time value is obtained right before the DAQmx read function is called, as shown below:

 

timestamp counter.PNG

 

Are you trying to use the 9411 to read from the mag pickup? What type of data does it output?

 

For information on programming with NI-DAQmx, please refer to the following webpage: http://zone.ni.com/devzone/cda/tut/p/id/5438 . It is a very useful resource to get started on DAQmx applications! I hope this helps. 

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 2 of 4
(4,000 Views)
Hi Vivek,

Thank you for the reply. I am collecting analog waveforms without any problem. I am using a method similar to what you show for creating an initial timestamp on the engine speed measurement. This should be accurate enough since this signal is updating every .0005 seconds. I am not sure this same method will work for the index pulse since it is only being updated every .1 seconds. The DAQmx read function is in a for loop which also runs every .1 seconds. The time at which the index pulse is read may lag up to .099 seconds after the pulse occurred. I think the accuracy of the measurement would depend on the phase shift between the pulse and the DAQmx read. Let me know if I am missing something here.

I think a better solution for me might be to sample the analog data based on the timing of the counter for the flywheel teeth. Can I use the implicit timing of the flywheel teeth counter as the source for the analog counter? I realize I would no longer have waveform data but I could create an XY graph instead. I hope I explained this clearly. Let me know if you have any questions.

Thanks again,

Kris
0 Kudos
Message 3 of 4
(3,983 Views)

Hello Kris,

 

We will continue assisting you through the service request you have open with us. For any follow-up questions, please call or e-mail us on that service request. Thank you.

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 4 of 4
(3,956 Views)