11-23-2012 02:00 PM
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?
Solved! Go to Solution.
11-23-2012 02:27 PM - edited 11-23-2012 02:27 PM
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.
11-23-2012 02:29 PM
11-23-2012 02:37 PM - edited 11-23-2012 02:42 PM
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 😉
11-23-2012 02:43 PM
@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 😞
11-23-2012 02:59 PM
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?
11-23-2012 03:12 PM
11-23-2012 03:16 PM
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
11-23-2012 03:21 PM
11-24-2012 03:01 PM - edited 11-24-2012 03:02 PM
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.