Problem about selecting waveform in waveform graph

Hi all:
I am developing a project by Labview. Now I meet a problem about selecting the waveform in the waveform graph.
I am not sure whether it is possible about my idea.
for example:
In the waveform graph,  the different waveforms from a couple of channels are displayed. and then I want to select one waveform of them, and corresponding data about this waveform are shown. 
Thanks so lot
regards

hanwei wrote:
1.  can I zoom in and out in that "waveform graph"??
You can do this using the graph palette. Just make it visible. The middle control allows you to zoom.
2.  can I display the plot array or plot index that I select in the waveform graph?
You can connect the same wire that goes to the ActivePlot property node to an indicator.
3.  I build a sample codes for my project, in which , I used a random number generater to simulate a DAQmx data collection, and generate a overlapping waveform in the waveform graph.
     but it seems the program is not stable, when i first run the codes, it is ok, and I can select the plot what I want. but after I stop and restart the program, there is error message about "Property Node".
     it seems something wrong about the "waveform graph properties"
I attached my codes here, anybody know what wrong about it?
For some strange reason the property node is "messed up". I've seen this happen sometimes with graphs. I don't know what causes it, and the only way I've found to fix the problem is to delete the graph, put a new one on the front panel, and recreate the property nodes. I've typically seen this happen when copying code from another VI that has a graph with property nodes, as I suspect you did. If you delete the graph, put a new one on there, and recreate the property node you should be OK.
That said, a few comments regarding the code:
The architecture seems to be a mish-mash of operations, and I'm thinking that you probably want to look at using a producer-consumer architecture. Your producer loop responds to events, and the consumer loop does your DAQ collection.
You have a race condition with your use of the "size(s) 2" local variable.
Avoid right-to-left wires.
The method of creating your arrays seems convoluted. However, since you said you will actually be getting the data from a DAQ system, the actual project code will likely be considerably different.

Similar Messages

  • A problem about the compression of directed graphs

    Right now I encountered a problem in my research that is about graph compressing (or contraction, etc.). I've searched in various ways for existing techniques on this problem and found nothing. I've been trying to figure out this problem by myself. However I would also like to seek some advice from you guys.
    The description of this problem:
    Given a directed graph G = (V, E) where V is the set of vertices and E
    is the set of directed edges. These vertices and directed edges
    represent the events and the directional relationships between pairs of
    events. Each edge is associated with a weight (or confidence score)
    which indicates the degree of the relationship. Now I want to compress
    the graph by merging some of the vertices into one superior vertex,
    which implies that several lower-level events are merged into one
    high-level event (this is mainly because the extent of news events
    defined are usually flexible). After that we can reorganize the
    vertices and edges and repeat this process until the size of the graph
    reaches a certain limit. Purely looking from the point of graph theory,
    is there any existing graph algorithm that solves this problem? As far as I have searched, the answer seems to be negative.This seems to be an interesting novel problem which falls in the area of graph algorithms. Could you suggest anything? Attached is a sample directed graph of such a kind which may be interesting.
    Check this URL to find out more about this kind of DAG:
    http://ihome.cuhk.edu.hk/~s042162/2005-05-24.jpg
    Thank you very much for your time and help.
    Regards,
    Daniel

    Sounds like an interesting problem. The temporal aspect presents an interesting wrinkle. Graph models have been becoming popular for the standard clustering problem recently, but they are typically undirected formulations. The idea of compressing a graph reminded me of work done by G. Karypis and V. Kumar on graph partitioning, some of their papers are available here:
    http://www-users.cs.umn.edu/~karypis/publications/partitioning.html
    SImilar to the reference given by matfud, with the additional restriction that there may be a size restriction on the size of the partitions or there may be multiple partitions (both restrictions make the problem NP-complete, IIRC).
    There's also the area of spectral graph partitioning which may be of interest. Its a way of finding relatively dense areas in a graph by using the eigenvalues of the adjacency matrix. Most of the results in this area are dependent on the fact that adjacency matrices for graphs are symmetric and semi-definite, which wouldn't be the case for a directed graph, but could be worth some experimentation if you have MATLAB or something similar.
    There's something else this problem reminds me of, but I can't think of it right now. Maybe later something will come to me.
    Good luck.

  • Problems graphing FFT of sine wave with Waveform Graph

    I know that this type of question has been posted
    many times, so I apologize for posting a similar one. Unfortunately,
    after reading quite a few threads I still have a question or two.
    Basically, I need to use a Waveform Graph (not an XY graph) to graph
    the magnitude of an FFT of a sine wave. I can't figure out which VI I
    should be using to obtain the magnitude of the FFT. I think I'm using
    the proper FFT vi (just the regular FFT.vi), but I can't find a VI
    dedicated to magnitude. Of course, I could be misinterpreting the
    pseudocode which I am following.
    If you
    wouldn't mind taking a gander at my VI, I'd appreciate any input you
    might have. The pseudocode is contained in the block diagram. You
    can see that I have another graph for just the sine wave, and I think
    that works as it should. I'm primarily concered about the waveform
    graph which isn't currently connected to anything, but should
    eventually be hooked up to the FFT.
    Thanks!
    Attachments:
    Labview5.vi ‏199 KB

    Your problem is that the output of the FFT is an array of complex numbers. Take the magnitude and you will be able to plot it.

  • Editing the waveform graph

    Hi,
        I have encountered some problem is finding waveform graph. I downloaded the tutorial for ASK modulation i tried to do a new one as practice. But the graph are very different. it seems that the borders are transparent which can only see the graph portion only. I have tried to use waveform graph from the graph palettes. I edited it by stretching the graph (waveform result) area and unchecked the visible plot legend, scales and etc.. but i just can't do it the same as the example and the waveform at the bottom is slightly different also (but i don't know isit different scales). I have no choice but copy the graph and paste on mine. Anyone know the trick or tips in doing it? Thanks..
    Attachments:
    ASK.vi ‏53 KB
    simple_ask_transceiver (SW).vi ‏172 KB
    Image.PNG ‏21 KB

    Hi Serina,
    have you tried to use the waveform graph/chart from the "Classic" palette?
    Those controls/indicators have a "flat" look making a lot easier to hide unneeded features
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Negative scale on a Y log scale waveform graph.

    I have a problem with my waveform graph : I would like to set Y negative scale in a logarithmic mode. How can I do that? It seems to be impossible (always set to '0' if a set negative value)! What is the problem ?
    Thank's in advance.

    Hi,
    no problem,
    see attached file.
    Regards
    Mike
    GAP wrote:
    > I have a problem with my waveform graph : I would like to set Y
    > negative scale in a logarithmic mode. How can I do that? It seems to
    > be impossible (always set to '0' if a set negative value)! What is the
    > problem ?
    > Thank's in advance.
    Attachments:
    NegativeData.vi ‏27 KB

  • Problem with select all cells in JTable

    Hi guys! I get some problem about selecting all cells in JTable. I tried to used two methods:
    1> table.selectAll()2> changeSelection(firstcell, lastcell,false,true)
    firstcell:[0,0], lastcell[rowcount-1,colcount-1]
    Result: only the first row selected when i use both methods.
    Note: i set up the selection model as following:
    this.dataSheet.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                    this.dataSheet.setCellSelectionEnabled(true);
                    this.dataSheet.setRowSelectionAllowed(true);
                    this.dataSheet.setColumnSelectionAllowed(true);Thanks !

    What selection properity should be changed in order to enable selectAll() method work properly? Is there Any constraints? Here is the TableModel I am using. And i set up selection mode use the following code:
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    table.setCellSelectionEnabled(true);
    table.setRowSelectionAllowed(true);
    table.setColumnSelectionAllowed(true);
    import java.util.Vector;
    import javax.swing.table.*;
    import javax.swing.JTable;
    public class DataSheetModel extends AbstractTableModel{
              private Vector data = new Vector();//Store data
              private Vector columnNames = new Vector();//Store head
              public DataSheetModel(){}
              public DataSheetModel(Vector headVector, Vector dataVector){
                   if(headVector != null) this.columnNames = headVector;
                   if(dataVector != null) this.data = dataVector;
              public int getColumnCount(){
                   return columnNames.size()+1;
              public int getRowCount(){
                   return data.size()+1;
              public String getColumnName(int col){
                   if(col==0) return "";
                   else return (String)columnNames.get(col-1);
              public Object getValueAt(int row, int col){
                   if(col==0) {
                        if(row != data.size()) return String.valueOf(row);
                        else return "*";
                   else{
                        if(row != data.size()){
                             Vector rowVector = (Vector)data.elementAt(row);
                             return rowVector.elementAt(col-1);
                        }else return null;
              public void setValueAt(Object value, int row, int col){
                   if(row != this.data.size()){
                        Vector rowVector = (Vector)data.elementAt(row);
                        rowVector.set(col-1,value);
                        this.data.set(row,rowVector);
                        this.fireTableDataChanged();
                   }else{
                        Vector rowVector = new Vector();
                        for(int i=0; i<this.getColumnCount()-1; i++) rowVector.add(null);
                        rowVector.set(col-1,value);
                        this.data.add(rowVector);
                        this.fireTableDataChanged();
              public Class getColumnClass(int c){
                   return getValueAt(0,c).getClass();
              public boolean isCellEditable(int row, int col){
                   if(col == 0) return false;
                   else return true;
              public void setDataVector(Vector head, Vector data){
                   if(head != null) this.columnNames = head;
                   if(data != null) this.data = data;
    }

  • A question about Waveform graph

    Hello everyone.. I have made a waveform graph to measure pressure with my DAQ NI-9237. The problem is the time value in the x-axis shown on the picture below. It only shows the measurements from 0 to 1, but i need from 0 to 4 seconds. 
    Thanks in advance
    Oesen
    Best regards
    Oesen

    Hi Oesen.
    It's because you convert your data to a double, which does not contain any information about the time. Instead, simply delete the 'Convert from Dynamic Data' and wire in the dynamic data directly to the chart. The Waveform Chart supports this datatype as well.
    Another solution is to keep the 'Convert from Dynamic Data', but instead of converting the data to doubles, you convert to a waveform. You do this by dobbel-clicking on the function and select 'Single Waveform' in the list. I personally think this is the best solution, since you are now able to work with your data in a way the dynamic datatype won't allow you. Try and wire the waveform to 'Get Waveform Components' and see how data is stored.
    You can read more about the waveform datatype here:
    Using the Waveform Data Type in LabVIEW
    http://digital.ni.com/public.nsf/allkb/B965F316364​DE17B862572DF00363B10
    I hope this information is helpful.
    Best Regards
    Alex E. Petersen
    Certified LabVIEW Developer (CLD)
    Application Engineer
    Image House PantoInspect

  • Working with dynamic scales in waveform graph - display problem

    Hello
    I want to use the same waveform graph in the frontpanel for different measurements. These measurements contains 1 to 8 curves, some of them I need to autoscale and others I want to use fixed scales. I wrote a method containing these functions and the functional behaviour is how I expected. But when it runs several times, LabView cannot correctly manage the graph display. Some scales are behind the graph or two scales are at the same position.
    Perhaps you have a look at my example VI (LV 7.1), I generate a random Waveform and want to display a random number of curves and some of them in fixed, and some in autorange. The more I run the VI, the more the waveform graph display gets wrong. Does anybody know a solution?
    Thank you very much for answering!
    sparti.
    Attachments:
    ScaleProblem.vi ‏165 KB

    hi there
    Ben, thanks for the link. Christian's suggestion is right and describes a similar problem.
    I solved the problem now on an other way. Each time before I change the visability of the scales I reset all settings to the default (startup) values by property nodes (YScale.Maximum, YScale.Minimum, All Visible...). Then I make the scales which I don't need unvisible, link the graphs to the prefered scales and set the Min/Max or autoscale.
    Important: I got 4 scales on each side. When I want to use eg 2 scales on the left, I need to make visible scale number 1 and 2. Scales 3 and 4 can then be set to unvisible (in other words in an incrementing order).
    Makeing scales visible and unvisible is a little bit nervous on the screen. So, during that process I bring a picture of the last waveform on the top of my screen and change to the graph view when all settings are done.
    Now I got a really great waveform viewer with the possibility, scaling some graphs by autoscale, others by fixed scales, using up to 8 scales selectable on the left/right side, user definied colors, names and units.
    Thank you all for taking part of my problem.
    sparti

  • How can I programmatically remove a selection of plots from a waveform graph?

    I have a waveform graph to display a number of plots, which I need to programmatically add and delete to as selections of data are chosen by the user for display.
    I've looked under the VI Server Property node and cannot see anything suitable for adding extra plots, or removing existing plots. I expected to see a Plot Data array variable, with each element containing the data for each of the plots on the graph. There is such an array for the annotations, which I can easily edit by Removing Subset for Array, or Insert into Array, but nothing for the plot data. The Value property is a Variant, which I'm unsure how to handle. Should I be working with this perhaps? Can this be done by creating a Local Variable read node? Or am I missing something simple here??
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

    Hi Mike,
    I was trying to use the Property Node (Value) to read the waveform graph, but I was getting a Variant type back, not a 2D array of DBLs as I expected. Turns out I was passing the graph control reference to a subvi whose control refnum had the Include Type flag unchecked. As a result of this explicit definition, Value was of an uncertain (undefined) type and couldn't be natively provided. It would have had to have been cast into a more specific type to work. Have solved the problem by ensuring all my references are of a strict type, and now (as you recommend) the Property Node (Value) is useful
    Many thanks for the response!
    And many thanks for the demo too! You put that together remarkably quickly!
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Problems with Waveform Graph

    When I add a Waveform Graph into the Front Panel, the Block Diagram Window shows it as DBL instead of the usual indicator for the Graph. How can I solve this problem?
    Attachments:
    Question.vi ‏9 KB

    I don't see what the problem is. The default waveform graph type is an array of doubles and that's what your diagram has. If you create a waveform data type and wire it to the indicator, it will change the graph's icon.

  • XControl Data wiring problem - Data type is Waveform Graph (Strict)

    Hi,
    I created an Xcontrol for a waveform graph. The datatype (under Data 1.ctl) is a WaveformGraph reference type.
    When I wire a Waveform graph reference to the Xcontrol (as an indicator), there is a wire conflict.
    I checked the strict definition and the reference types are theoretically congruent but I cannot seem to wire it together. Any solutions?
    Please see the attached code.
    Thanks!
    Attachments:
    GraphDisplay XControl.7z ‏1717 KB
    Tester.vi ‏15 KB

    It looks like the XControl data is a waveform reference (strict). I can't open the XControl though, because I don't have a 7z compiler, but the problem is probably that the refnum will only take in a reference to an exact waveform graph because it's strict.
    You can create a non-strict reference and use that for your data by:
    Open your data control FP
    Press Ctrl-Space
    Type "Control Refnum"
    Press Enter and place that on front panel
    Right click it and brows to the correct data type:
    James
    LabVIEW Professional 2014

  • Play waveform graph problem

    hello,
    what i have is a waveform graph and i would like to play the waveform using the play waveform express vi.  my problem is the data type i am wiring into the express vi is not compatiable.  i understand the error, i just am not sure how to make it compatiable.
    you may ask why i don't just use the correct waveform graph.  the answer is that this waveform graph i have now is the result of filtering, fft, and ifft calculations and would like to get this graph to work and not change my previous work.
    thank you
    Attachments:
    playWave.vi ‏289 KB

    Hi,
    I think what you need to do is use the Build Waveform VI on the waveform palette. This 'bundles' the dt and Y array of values into the waveform data type which the graph and Express VI(s) will accept.
    I've done this for your data and attached the VI (this one is in LabVIEW 8.0 - let me know if you need it in an earlier version). I can hear the waveform playing on my machine (what IS it??   )
    For future reference, there are also 'From DDT' and 'To DDT' VIs on the Express->Signal Manipulation palette which can convert the Dynamic Data Type (the dark blue wire that goes into and comes out of the Express VIs) into waveforms, single numerics etc.... These may be useful if you want to work with Express VIs for analysis in future.
    Hope this is what you were after.
    Best wishes,
    Mark Lee
    Certified LabVIEW Architect
    Attachments:
    playWave.vi ‏292 KB

  • Problems in plotting wave in waveform graph

    I am trying to plot the wave in wavefrom graph. So to plot the graph i tried to bundle the values that i am getting as per the context help of waveform graph VI. Now according to VI i should have x & delta x value in double 64 bit real format, y should be in wavform data type (y array) (as i want to plot single plot). But the values that i am having, x value in 1D array double 64 bit real format, y value in 2d array double 64 bit real format from my VI named as "Agilent 36570 lvlib.Data Coord Trans Data.vi". I got this VI by adding the driver for Agilent DSA hp 35670A. But finally when i tried to connect the wire from cluster out terminal to input terminal of graph VI its showing error. I have also attached the snapshot of my error so as to clarify my problem. So how should i get rid of this problem.
    Thank you. 
    Attachments:
    Query_2.png ‏29 KB

    A wave form is not like plotting points on an x-y graph. A 1 dimminsion array is a waveform. But we usually want to look at the wave form over time. You have to set two additional values for the waveform.   It is a start time (T0) a sample frequency (delta T) in seconds and the the sampled points of the measured signal.  (1-D array of values)  This will display the waveform vs the correct time . To plot 2 or more signals make the array a 2 dimension array. See attached example vi . 
    Attachments:
    Graph.vi ‏18 KB

  • How can I label the peak in the waveform graph!

    Hello, my question is a little vague. I try to narrate it clearly.
    Thank you for your patience!
    I work with Labview 7.1. At a word, My question is how to label the
    peaks when using the while loop and the event structure with
    the dobule click event!
    1.Open the Why.VI and execute it.
    2.Click in the 'Acquire signal', then you will find two modes to upload
    the signals, press the 'Read' button and ignore the 'Sample',since 'Sample'
    mode need the support from the hardware, while 'Read' mode just upload file
    from disk,  select the 'Signal.txt'(inluded in the attachment), you will
    find two waveform shown in waveform graph,just like 'Pic1.jpg'. Up to now,
    there is no problem.
    3.Press on the 'Analysis' button and enter a new interface. Amplify the plot
    and selet the the a piece of waveform between about 3.02 and 3.06. Set the
    x coordinate of the 'Cursor 0' as 3.03 and set the width as 0.01. Move the cursor
    you will find two cursors(one vertical lines in yellow and another in blue).
    Double click the graph and select 'valley', two x coordinate values corresponding
    to the x coordinate of the two valleys are listed in the listbox. All above
    mentioned is shown in 'Pic2.jpg'.
    4.Let me explain my idea and my question now. What I have done is plot the waveform
    when clicking in 'Analysis' interface;then, amplify the waveform, select
    a certain area and move the cursors;at last, double click the graph, the waveform
    between the two cursors are selected and the peaks are identified.But, what I need
    next is to label the peaks in the graph as soon as I double click the graph,I
    can not realize this idea because the waveform is out of the while event, the coordinates
    of the peaks can not output until the while event is stopped. If I move the graph
    into the while loop,the selected area can not be keeped because the while loop will
    run continuously and will renovate the plot area to original area, but I want to keep
    the selected area for got the peaks conveniently. In short, My question is about how
    to label the peaks in the graph and keep the seleced area freely.
    This problem has puzzled me for a long time. May anyone give me some advice.
    Thank you for patience and really appreciate your help!
    BTWlease let me know if the VI can not run well!
    Attachments:
    Calculate velocity.vi ‏271 KB
    why.llb ‏389 KB
    Acquire.vi ‏213 KB

    Sorry, I try to compress the files in '.rar' ,but it is compatible with the web,I have to
    upload them in reply file.
    Attachments:
    signal.txt ‏684 KB
    Save file.vi ‏103 KB
    Get Waveform Time Array(0).vi ‏46 KB

  • Unexpected Windows cursor/Waveform Graph cursor behavior

    Hi,
    I got a very strange Windows cursor behavior with waveform graph. Simplified VI is attached.
    LabVIEW 2014 SP1
    The problem is:
    The VI contains only one waveform graph.
    1. I start the VI. Cursor Movement Tool is selected in the Graph Palette by default. Corresponding “Cross with dot” Windows cursor appears when mouse is moved over the plot area (see image). So far so good.
    2. I select Zoom in the Graph Palette and use it two-five times (second image).
    3. I select Cursor Movement Tool in the Graph Palette again but Windows cursor does not change as it should. It is an open cross now (third image); i.e. the same as shall appear when cross of Graph Cursor Lines is reached.
    4. I click mouse three-seven times anywhere in the plot area and the cursor becomes normal (as in the first image).
    The problem is not only in shape of the Windows cursor. The whole Graph cursor functionality does not work properly if the Windows cursor has the wrong shape.
    Please advise what could cause this problem.

    It seems, i cannot explain the question in good way
    It is not about my data or zooming. It is about strange bahaviour of the Graph. The following sequence of steps illustrates the problem and shows that the zooming is not the issue (or, at least, not the main issue):
    I do the following:
    1. Start the VI.
    2. Select first Graph cursor in Corsor palette and use pop-up menu "Bring to Center".
    3. Zoom couple of times (not too much) keeping the Grapg cursor visible.
    4. Select Cursor Movement Tool in the Graph Palette.
    5. "Open cross" Windows cursor appears from the beginning. I cannot pick up the Graph cursor.
    6. Click left button of the mouse several times in any poin of the graph area.
    7. Windows cursor is changed to the normal "cross with central point".
    8 Now I can pick up the Graph cursor.
    I would suspect problems with zoom until p.5. However p.6-8 are done without any change of the zoom.
    By the way, I found more:
    If I try to move the Graph cursor after p.5, the whole graph moves and fires event "Scale Range Change". It must not happen with Cursor Movement Tool selected.
    I can guess only about some strange setting of the graph. May be I am not aware about them

Maybe you are looking for