LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you generate a waveform from buffered counter data?

I am building an application which measures the speed of a shaft and then undertake an FFT to produce the torsional vibration spectrum (in real-time or delayed if necessary).

The shaft speed is measured using a 20MHz counter (which is buffered) on a shaft which outputs 149 pulses per rev, at a maximum speed of 6000RPM i.e max pulse rate of 15kHz.

I am relatively new to using Labview however I've been unable to find a way to generate a continuous waveform using buffered data?

Can anybody offer a suggestion on how to decompose the buffered data (array) into a single datastream?
0 Kudos
Message 1 of 5
(3,555 Views)
DTA,

The waveform datatype is a special type of cluster containing 3 elements:
  • an array of values (Y)
  • the start time (t0)
  • the time between samples in seconds (dt)
You can use the "Build Waveform" VI from the waveform palette to create a waveform output from these three inputs.

I'm not sure if I'm understanding your question correctly - if I'm not please let me know and I'll take another look at it.

Regards,

Simon H
Applications Engineer
NI
0 Kudos
Message 2 of 5
(3,520 Views)
I've done similar things before.  A few thoughts for you:
 
1. I'm assuming you're doing a buffered period or frequency measurement on the incoming encoder pulses, right?  First key point is that you'll have data that is spaced equally in position, but not equally in time.  If you are looking for a time-based FFT such that increasing speed will shift your spectrum, you're going to need to go through an interpolation process to resample your data as though equally-spaced in in time. 
 
2. Your 149 pulse per rev encoder may be a significant source of error unless its 149 pulses are placed with extreme accuracy.  Any error in pulse placement violates your underlying assumption of data that is equally-spaced in position.  It'll be very helpful to send your data through a software lowpass filter to attenuate those artifacts. 
 
3. I am not sure what you mean by "decompose the buffered data (array) into a single datastream."  You'll get an array of periods / frequencies from the call to DAQmx Read.  If you want to use it in a LabVIEW waveform datatype, you'll first need to do the resampling to create equally-spaced-in-time data.  The LabVIEW waveform datatype (and all the analysis functions like FFT that use it) depend on receiving data with a fixed constant time interval between samples.
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 5
(3,513 Views)
Thats correct I am recieving data spaced equally in position but not in time.  Which I can convert into angular velocity versus time easily using a loop. 

The difficulty that I am having is that the data coming of the buffer arrives as consecutive time period recordings rather than a continuous waveform.  This means that if you convert it to a waveform it displays as 0-x seconds for every buffer reading (I presume) hence the waveform graph is redrawn everytime rather than having contiguous data.  Is there a simple step that I am missing which will reassemble the data into one continuous stream? 

Unfortunately I am using the tradition NI-DAQ module as my acquisiton board is unsupported by DAQmx.
0 Kudos
Message 4 of 5
(3,491 Views)
A couple of things which may help you.
  1. If you are using a Waveform Graph, you have to give it all the data you want to plot every time you redraw it.  There is no buffer.  If you want a buffer, you need to use the Waveform Chart.  Depending on how fast you are streaming data, you will probably want to set a maximum on the number of points you keep (there is a default, which I think is 2048) to avoid running out of memory.
  2. If you want the first timestamp to show up on a Waveform Graph, you will need to set it in the waveform as mentioned above.  In addition, you will need to set the graph to actually look at it.  Right click on the graph and unselect the option which ignores the timestamp (the graph data type needs to include a timestamp for this option to be shown).  This will change the formatting of your X-axis, so you may want to reformat it to something else.  Note that your timestamp can be relative and/or negative and it will be handled correctly by the graph.
Let us know if you need more info.
0 Kudos
Message 5 of 5
(3,473 Views)