04-03-2013 02:30 PM
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
Solved! Go to Solution.
04-04-2013 12:15 AM
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
04-04-2013 02:47 PM
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.
04-04-2013 02:47 PM
test waveform is sub vi. see attached
04-04-2013 02:54 PM
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.
04-04-2013 03:04 PM
Awesome i think i got it.thanks!