Showing results for 
Search instead for 
Did you mean: 

Pull out individual graph from a multiple graph waveform?

Go to solution

Hi all, is there a way of parsing out individual graphs from a waveform based on a given description?  I know that the waveform only has the Y, t0, and t attributes, but there must be a way of doing this.  


The user inputs a cluster of data per channel.  What I'd like to be able to do is isolate a single graph from the waveform based on the TAG name of the channel, and show this on a separate graph.


I've attached screen shots shots of the code where the plots are generated, and of the user input cluster.


I'd greatly appreciate any help.  THANKS!


LabVIEW 2012

Windows 7 64-bit


Download All
0 Kudos
Message 1 of 11



Could you post your code in LV 2010 or lower?


Thank you


Also, there is something called Attributes of a waveform. if you are acquiring waveform data type from a device, then you can set the waveform attribute ChannelName while acquiring, and read it back later on so that you can compare and index your waveforms. 


If you are acquiring from an NI Device and using DAQmx to set the channel names, then the waveforms take the channel name set during configuration. 


Even otherwise, when you are acquiring the data and building the waveform data type/ array, you can use the Set Waveform attribute function to set the channel name. Use Help menu of this function for more details


I hope, this is what you wanted.


Edit: you said individual graphs, i udnerstood them as plots on a graph. also, i assumed that you are having an array of waveform data clusters. Also, a waveform has to, dt, Y array AND attributes.


TestAutomation Consultant
0 Kudos
Message 2 of 11

Attached is part of my VI.  Its a large project with various folders so I am only attaching the main VI.  It is still a little messy; so I apologize.  I believe the the area where this parsing would be done is in the "New DAQ" case in the "Main  Processing Loop".



0 Kudos
Message 3 of 11



Attached is the picture of how i modified your code. In the DAQ Loop case where you are creating task, use your Tag name as the channel name


In the Main Processing Loop, insdie the New DAQ case, you are reading the waveform and using a case structure. By using the Get Attribute function and reading the value of NI_ChannelName, you can get the task name of each channel read/acquired.


I had just left an indicator at the output for the Channel name. you can use it for a case strucuture or in any which way you like.


Let use know if this works.

TestAutomation Consultant
0 Kudos
Message 4 of 11

Thanks Freelance.  I tried it the way you suggested, and it seems that now it is only taking the very last input channel, and not looping through and gathering all the channels.  This is definitely the right direction of how I want to be going though, because then I can just use the tag name to do further analysis on the different plots.  Can you see how I might be able to get it to loop through until all the channel data is acquired?


thanks so much for your prompt responses!

0 Kudos
Message 5 of 11



The channel name string indicator inside the For loop (New DAQ case) will show only the last channel name. if that is what you are talking about.


if you want all the channel names, then bring the attribute function output to outside the loop and wire to an array of string indicators.


If this is not what you meant, then, please post your edited code, after the changes you made. then, we will have a look.


TestAutomation Consultant
0 Kudos
Message 6 of 11

Freelance this is great, it's almost exactly what I need.  So I'm able to display an array of all the tag names, using the suggestions you gave in your last post.  Now what I ultimately want to be able to do is ouput a graph using a given tag name.  For example, I only want to output the graph of Tag1, instead of just displaying the name in an array.  Is this doable? When I tried to output into a graph instead of an array, it gave me an error saying the sink and source were different types.  When I tried to put a waveform constant in the get waveform attribute "default value", it gave me an error saying "The data type of the variant is not compatible with the data type wired to the type input."


You've been a great help so far, if you can help me get the final part of this puzzle, my project will be complete.  Thanks as usual!

0 Kudos
Message 7 of 11
Accepted by topic author AKN_12



You can do it. When you get the Attribute name (as in my first attachment), you can compare it with the Tag Name you want, using the functions in the Comparison palette.

Then, if your match is found, then put a case structure and write the waveform to a Graph.

Else, pass the waveform through a shift register and write to the Graph.


I have attached a VI in LV 2010.

TestAutomation Consultant
0 Kudos
Message 8 of 11

Freelance, I believe it works now.  Thank you so much for your help!


 I've attached a screenshot of how I have it set up.  IT works as planned, however the legend on the final chart is empty.  Is there anyway to keep the waveform names? That is the last thing missing.


thanks again

0 Kudos
Message 9 of 11

Hi AKN_12,


Have you tried using the Set Waveform and setting the name to NI_ChannelName and selecting the value to be the name you would like to display for the legend?



Kaitlin N.
National Instruments
Applications Engineer
0 Kudos
Message 10 of 11