LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you covert a graph into an array?

I would like to convert a simple graph, in this case a sine wave into an array.
0 Kudos
Message 1 of 7
(4,290 Views)
Just use the "history" property of the graph.  Create a property node, then select the "history" property, and you'll get a 1D (likely for just a sine wave) array out of it.
0 Kudos
Message 2 of 7
(4,284 Views)
The input to a graph is an array. It might be a 1D or 2D array of numbers or it might be a y array contained in a waveform or dynamic data type. Please specify what exactly is the input to the graph. Now, if you really are talking about a chart and not a graph, then Novatrons answer applies.
Message 3 of 7
(4,278 Views)
The function I am looking at is a current vs time graph being outputted from a DAQmx read. It should be as simple as placing the graph in the array but the output from the DAQ does not match the input to the array.
0 Kudos
Message 4 of 7
(4,271 Views)
OK, firstly I doubt that anything is outputting a graph.  It might be displayed as a graph on the front panel of the sub-VI but the output will most certainly be some kind of array construct (The actual data the graph will display).

Try right-clicking on the wire coming our of the sub-VI and select "probe".  This will show a minimal display of the data type.

Most graphs accept different data types, so you'll really need to dig deeper as to exactly what data is being outputted.

Again, a graph is an object for displaying data, the data it contains will be in some way array-based.  You may need to format the data into the correct form for your further functions, but try not to confuse front-panel objects and the data they display.

I don't have DAQmx installed, so I can't look at the actual data types exported......

Hope this helps a ltitle anyway

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 7
(4,254 Views)
It depends on how you're reading the samples from the DAQ.  Are you reading 1 sample at a time in a loop, many samples at a time, different channels?

Which type on indicator are you using?  Dennis was right in noting the difference between graph/chart indicators.

Post your vi and we'll be better able to help!
0 Kudos
Message 6 of 7
(4,253 Views)

DAQmx Read can return a 1D array, 2D array, waveform data type or an array of waveform data types. Here's a picture that illustrates the different data types and the different techniques. Look up in the on-line help the topic data types for a table that describes their appearance on the block diagram. Being able to recognize, describe, and understand the various data types in LabVIEW is important.

Message Edited by Dennis Knutson on 06-08-2006 08:54 AM

Message 7 of 7
(4,254 Views)