LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform Graph - get y values

Solved!
Go to solution

Hi,

 

I am working on a group project where my team member is giving me a waveform graph as an output from their sub vi.  I need to use the amplitude (y values) from the waveform graph for my part.  I believe I am supposed to use "index array" to do this but I'm not quite sure how.  Could someone help.. possibly provide an example? Thanks

0 Kudos
Message 1 of 6
(6,992 Views)

Hi Sara,

 

If the waveform graph is being used in a subVI, then your VI that is calling the subVI will see the waveform graph as an array. The graph itself is just a front panel control to graphically display the array of data. Since it is being used as a subVI, it will pass the array back to your calling VI. What is the datatype of the array being displayed on the graph? If it is double or integer, then you directly have your amplitude values already, however if it is a waveform or a dynamic data type, you will need to get the specific components of the data.

 

Have you tried looking in the example finder in LabVIEW? There are a number of examples in there that deal with the fundamental concepts of LabVIEW. Feel free to post your attempts to solve the problem and people here will be happy to show you where you are going wrong. It is a great community for learning LabVIEW, especially if people can see you are making an effort and not just asking for homework solutions!

 

Jeff Peacock

 

Product Support Engineer | LabVIEW R&D | National Instruments

0 Kudos
Message 2 of 6
(6,971 Views)

Thanks for your reply.

 

The data type of the array being displayed on the graph is double but I still can't seem to access the amplitude data.  

 

I've attached a simpler test case of what I'm trying to achieve.  I need to access each value in the array one by one.

0 Kudos
Message 3 of 6
(6,953 Views)

test waveform is sub vi. see attached

0 Kudos
Message 4 of 6
(6,951 Views)
Solution
Accepted by topic author sally99

Hi Sara,

 

This is because the data type of your waveform graph is actually a cluster, if you turn on context help (ctrl+H) and move your mouse over the wire, you see the components of the cluster (two doubles and an array of doubles).

 

You can use unbundle to extract the different elements (the array is what you want). If you move your mouse over the Waveform Graph with context help turned on you, you can see what each part of that cluster means. 

The first double is x0 (the starting x position), the second double is delta x, and the final component is the array of amplitudes (y values). At the bottom of the context help window is a detailed help link that will take you into the help where you can get more information about waveforms.

Message 5 of 6
(6,948 Views)

Awesome i think i got it.thanks!

0 Kudos
Message 6 of 6
(6,945 Views)