LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger threshold and superimpose load cell data on chart/graph

Highlighted

I'm relatively new to LabView and I'm trying to make a VI for measuring load on a small laboratory rolling mill. The load cells are always under a certain amount of preload until a piece of metal is rolled, at which point a narrow peak signal will be generated similar to an impulse. 

I'd like to do the following:

  1. Continuously sample preload values and trigger a different sequence when a specific threshold is reached (i.e. sense when material is actually being rolled)
  2. Sample and plot load data as material is being rolled
  3. Revert to continuous preload sampling when material isn't being rolled
  4. Repeat this process for additional rolling loads that are detected and superimpose the output on a single chart/graph
  5. Export all rolling loads that are detected to Excel

I have a good idea of how to setup a threshold with doing comparative operators and how to write data to a file. I'm not sure how to superimpose data obtained at different times on a single chart/graph and what that means in terms of memory. 

Do you have any suggestions on how to go about this?

 

 

0 Kudos
Message 1 of 4
(629 Views)
Highlighted

Are you using any hardware?

0 Kudos
Message 2 of 4
(592 Views)
Highlighted

Using a myDAQ with external excitation voltage. 

0 Kudos
Message 3 of 4
(590 Views)
Highlighted

If the expected durations of each "sample" are similar, it shouldn't be too hard. (Edit: to be clear, the below applies even if they're not similar, just your graph will by default be harder to read due to a long X timescale for the long measurement, and concentrated data at low X values for the short measurements)

 

You make it sound like you already have the acquisition working - is that true? If not, we can discuss that more. However, I'm going to write now assuming that you have acquired a set of N double values and you're in the process of acquiring a new set of M (close to N) values for a second roll.

 

The way you want to plot these will be best served by a Graph, Waveform or XY should both be fine if the sampling rate is constant. If you have variable sampling, I'd suggest the XY Graph, but both can be made to work with some effort.

 

The inputs for multi-plot display on XY Graph (taken from "Detailed Help", see Context Help (Ctrl+h) for the graph on the block diagram) are as follows:

Displaying Multiple Plots on XY Graphs

The XY graph accepts three data types for displaying multiple plots. The XY graph accepts an array of plots, where a plot is a cluster that contains an x array and a y array.

The XY graph also accepts an array of clusters of plots, where a plot is an array of points. A point is a cluster that contains an x value and a y value. The XY graph also accepts an array of clusters of plots, where a plot is an array of complex data, in which the real part is plotted on the x-axis and the imaginary part is plotted on the y-axis.

 

and for Waveforms (most parts copied, some ignored, emphasis mine):

Displaying Multiple Plots on Waveform Graphs

The waveform graph accepts several data types for displaying multiple plots. The waveform graph accepts a 2D array of values, where each row of the array is a single plot. The graph interprets the data as points on the graph and increments the x index by one, starting at x = 0. Wire a 2D array data type to the graph, right-click the graph, and select Transpose Array from the shortcut menu to handle each column of the array as a plot. This is particularly useful when you sample multiple channels from a DAQ device because the device can return the data as 2D arrays with each channel stored as a separate column.

The waveform graph also accepts a cluster of an initial x value, a delta x value, and a 2D array of y data. The graph interprets the y data as points on the graph and increments the x index by delta x, starting at the initial x value. This data type is useful for displaying multiple signals that are sampled at the same regular rate.

The waveform graph accepts a plot array where the array contains clusters. Each cluster contains a 1D array that contains the y data. The inner array describes the points in a plot, and the outer array has one cluster for each plot. The following front panel shows this array of the y cluster.

(Image didn't upload, view the real help)

Use a plot array instead of a 2D array if the number of elements in each plot is different. For example, when you sample data from several channels using different time amounts from each channel, use this data structure instead of a 2D array because each row of a 2D array must have the same number of elements. The number of elements in the interior arrays of an array of clusters can vary.

The waveform graph accepts a cluster of an initial x value, a delta x value, and an array that contains clusters. Each cluster contains a 1D array that contains the y data. You use the Bundle function to bundle the arrays into clusters and you use the Build Array function to build the resulting clusters into an array. You also can use the Build Cluster Array function, which creates arrays of clusters that contain the inputs you specify.

The waveform graph accepts an array of clusters of an x value, a delta x value, and an array of y data. This is the most general of the multiple-plot waveform graph data types because you can indicate a unique starting point and increment for the x-scale of each plot.

 

So basically, you might consider the plot array option, or the line below that discussing an array of clusters. You can store your array in a Shift Register, and append a new cluster to it each time you acquire new data. In either case, you'll probably want an array of clusters, and the formatting of the cluster just varies depending on what's convenient for your acquisition, and whether you want the Waveform or XY option.

 


GCentral
0 Kudos
Message 4 of 4
(584 Views)