LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to extract required data from waveform

Solved!
Go to solution

I prepared a VI for acquisition and analyse. I have to manuplate data from NI 9203 (current source). I have to use a lot of channels and more than 1 sample from one channel so Daqmx read vi comes out waveform module and it is not a choice for 1D array. How could I scale data from this form and display 2 diffferent scaled data in a waveform graph?

Egemen
Download All
0 Kudos
Message 1 of 15
(11,365 Views)

Look at the "Waveform Graph" example:
C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\general\graphs\gengraph.llb

 

(change the link for your version of LabVIEW or go to "Find Examples..." under the LV Help menu)

 

This shows you various ways to display plots.

0 Kudos
Message 2 of 15
(11,354 Views)
That is a coercion dot and in this case, it means you are losing data. A 1D waveform array has multiple 1D DBL arrays so your subVI makes no sense. You would need 2D array in the subVI or index the waveform array and manipulate the waveform. You can wire a waveform into those arithmetic functions just like you can with a scalar or 1D DBL. You also would not be ick throwing away the timing information.

For a graph, you can right click on a scale and select duplicate. You click on the legend to assign different plots to a scale.
0 Kudos
Message 3 of 15
(11,352 Views)

The red dot indicates coersion. It's not necessarily bad,just a warning to be careful.

Is the waveform data wired to p-v-m raw terminal?  If so, that explains the coersion.

Coersion occurs when a wire is along 2 different types.

 

EDIT:  took too long to submit post 😉

0 Kudos
Message 4 of 15
(11,346 Views)

@Dennis_Knutson wrote:
That is a coercion dot and in this case, it means you are losing data. A 1D waveform array has multiple 1D DBL arrays so your subVI makes no sense. You would need 2D array in the subVI or index the waveform array and manipulate the waveform. You can wire a waveform into those arithmetic functions just like you can with a scalar or 1D DBL. You also would not be ick throwing away the timing information.

For a graph, you can right click on a scale and select duplicate. You click on the legend to assign different plots to a scale.

Thank Dennis, but this 2D array conflicts me. In what form this 2D array out from read daqmx vi? Does it include time info? How could I regulate it? I recognized that when I uses index array and get waveform components it takes elements one-by-one and output it as a 1D array including just one data. When I use all channels (8-channels) of the device I have to do it 8 times? Really conflicting 😞 And I could not find any proper example to understand this waveform data and its applications. I all checked waveform examples of Labview 2009 and they do not include what I want 😞

 

 

Egemen
0 Kudos
Message 5 of 15
(11,344 Views)

Please help me on this issue. All I want:

 

1. Scale the analog data (y=mx+b) in the waveform

 

2. And show that data on a waveform graph. I want to use waveform graph because it shows times. After scaling how could I build it again?

Egemen
0 Kudos
Message 6 of 15
(11,341 Views)
After scaling, just use the build array to combine all of the separate elements and wire it to the graph.
Message 7 of 15
(11,334 Views)
Solution
Accepted by newbieeng

The DAQmx Read is returning an array of waveforms.  Each waveform has components t0, dt, Y, and optional attributes.  See the Waveform palette for tools to extract the components and to build waveforms.

 

To do your scaling you need to do these things:

1. Select the waveform you wnat to scale by using Index Array or Index Waveform Array.vi.

2. Get the Y component of the selected waveform.

3. Scale it so that Y' = m*Y=b where Y is the original array and Y' is the scaled array.  You can use standard numeric functions for * and + because they work for arrays and scalars.

4. Build a new waveform using Y'.

 

Lynn

 

Scaled waveform.png

Message 8 of 15
(11,331 Views)
You can also apply a scale with DAQmx and skip all of the separate math functions.
0 Kudos
Message 9 of 15
(11,327 Views)

Thank you all for your valuable suggestions. I handled the problem like below. One thing that I do not understand as I have written in one of previous threads is existing of one element after using get waveform data function. The function output is 1D array but it contains just 1 channels' datum. I really do not understand why it contains just one datum. For instance when I wire 32 thermocouples into 2 x NI 9214 I have to use index array for each channel. What is the logic of it?? What is the advantage of waveform data? What is the difference between a cluster and a waveform data... Endless questions... Maybe I am not too keen to work with so these could be silly questions for an expert Labview programmer. Anyway working 1D arrays is too easy for me so I used below program. Also Lynn's suggestion is too good. Thank you all again.

 

extract data from waveform in 1D array form

Egemen
0 Kudos
Message 10 of 15
(11,305 Views)