LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interval preset for write to measurement/text file (other than time save interval)

Hi,

I am wondering if it is possible to write to a measurement/text file at a user defined non-time save interval.

 

I am acquiring different physical signals (about 32) with Labview 2015 from non NI-Hardware (HBM Quantum X MX840a and MX1609, Heidenhain EIB741, Arduino-based FluxDAQ). The acquired data is sampled by time and write to a file without any issues.

Nevertheless, for the data analysis it would be helpful to have the data sampled by space instead of time. For instance, I currently save the data with a time rate of 10 Hz and I would like to save the data with a space rate of 0.1 mm.

Attached is a MWE (minimal working example) for a time save interval (see Figures, too).

time_save_interval_front.JPG

 

Time save interval - Labview 2015Time save interval - Labview 2015

 

Two signals are simulated: triangle and sine for travel and load, respectively. Furthermore, these signals plus the measurement time are saved in a file with the express VI Write to measurement file at the sample time given by the control Time rate when pressing the control Meas. Start. Instead of writing at a 10 kHz  sample time rate (in this case for the MWE) I would prefer to write at a 0.1 mm sample space rate.

Main problems (here the first decimal point of the travel values is taken into consideration because of the chosen sample space rate of 0.1 mm):

  1. Identify and search the multiples of 0.1 mm (0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9) in the travel values
  2. The increment of the first decimal point of the travel values may be non-consecutive:
    • 500.1256
    • 500.3265
    • 500.7521
    • 500.8569
    • 500.9963
  3. The first decimal point of a travel value may appear repeatedly:
    • 500.2356
    • 500.2659
    • 500.2787
    • 500.2989
  4. The operations performed on the travel signal must also be carried out on the other signals (load and time) to have the same number of data.
  5. Due to the long-term measurements, the space sampled data have to be written to a multi-file. File termination condition for starting a new file should be after a certain number of samples or when the control Meas. Start is switched again.

In theory: my first idea is to save the data into an array and after the file termination search for the multiples of 0.1 mm, interpolate in the case of b., calculate the arithmetic mean in the case of c. and write to measurement file with the express VI.

In practice: which is the best way to achieve this in LabVIEW?

 

Any kind of help or ideas will be really appreciated!

Thank you in advance

0 Kudos
Message 1 of 2
(2,299 Views)

You can certainly take measurements at equally-spaced intervals.  You'll need a sensor that has a means of taking a measurement when "space" changed -- something that comes to mind is a set of photocells spaced at 1 cm (or 1 mm or 1 km) intervals that "trigger" a reading (of something) when they are triggered.  [Did you notice the "when" in the previous sentence?  How did time get mixed in to a question about space?]

 

Instead of using a "spatial" trigger (which requires multiple "spatial" inputs), we can turn the problem around -- taking measures equally spaced in time, perhaps at a fairly high rate in order to determine the time when the object being measured is at (or near) a specified space.  Digital measurement (DAQ) techniques are well-developed and robust.  If you have multiple time measurements per spatial point, you can choose the time that the space component is nearest, and ignore the other measurements.  If you are measuring so slowly that you miss spatial readings, you can either (a) sample at a higher rate (generally easy to do) or (b) interpolate using the measurements on either side of the desired spatial point.

 

What's relatively inexpensive?  Sampling at a constant frequency at reasonable rates (such as 1 kHz); saving data to disk (16 channels of Dbl data at 1 kHz for 1 hour is about 500 M bytes.  If one channel is "space" and the other 15 are "data as a function of time", you can easily post-process the data as indicated above (by removing all the samples that aren't at equally-spaced data, and adding interpolated points if necessary).  

 

Notice that the above "temporal" sampling scheme of 16 "data" channels, with Channel 1 being "space" and the other 15 being "spatially-related data" has an "invisible" Channel 0, namely "sample time".  If you are sampling at 1 kHz, then you can reconstruct this "invisible" Channel 0 by simply numbering it 0, 1, 2, ... and considering them as milliseconds.  So when you post-process the 16-channel "spatial + data" channels and throw away the points not at integral spaces (but saving the corresponding Time, "Channel 0") or, if necessary, interpolating to get an integral "space" channel (which would mean also an intepolated Channel 0).  You could even do such "convert from equi-time data to equi-space data" processing "on the fly", using a Producer/Consumer Design so that you only save data at equally-spaced (from over-sampling and interpolation) samples.

 

Bob Schor

0 Kudos
Message 2 of 2
(2,199 Views)