LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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
 
0 Kudos
Message 1 of 11
(3,532 Views)
hmm, I don't know if you can do it directly, but you could have the user look up the label from the legend.  Then they could use a listbox to select a signal that will show the data? 
0 Kudos
Message 2 of 11
(3,528 Views)
Hi drewsky
 
Thanks for your replying.
 
but I am not sure what does "user look up the label from the legend" could you give me more hints?
 
sorry about that, I am just a beginner
 
regards
0 Kudos
Message 3 of 11
(3,513 Views)
I wrote a couple of examples showing 2 different ways of doing this. You can find them in this thread. The first example uses a dropdown to select the plot. The second example lets you click on the plot. This second example is at the end of thread.


Message Edited by smercurio_fc on 07-22-2008 03:58 PM
0 Kudos
Message 4 of 11
(3,507 Views)
Hi!

If you use a waveform-graph, you have the graph-legend which says "plot 1", "plot 2" and so on...you can rename this captions by using a property-node, setting the active-plot to your plot-number and then use a property-node to set plot->plotname to a caption. You can then fill a ring-control with these plot-captions and there select the plot you want to show the detailed information for.

There's also a possibility to do it the way i think you like to do it...i am using lv 8.5, so i can't speak for other versions: there is a invoke-node called "get plot at pos". Wire a coordinate (x,y) to this node and you get the plot-number out. The coordinate you clicked at can be gained by an event-structure...

Good luck

Christian

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 5 of 11
(3,504 Views)

Hi smercurio_fc:

Thanks so much, that what I want to impement!! I really appreciate your help.

But I still have some questions about it.

1.  can I zoom in and out in that "waveform graph"??

2.  can I display the plot array or plot index that I select in the waveform graph?

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?

thanks a lot

 

0 Kudos
Message 6 of 11
(3,463 Views)

@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.

0 Kudos
Message 7 of 11
(3,445 Views)

Hi smercurio_fc:

Thansk a lot, I really appreciate your help.

 

I think the problem which casue the "messed up"  of property node should be something about "race condition" problem.

But I am sorry , I don't really understand what is race condition problem and why there is such a problem in my sample codes?

 

Thanks for your suggestion, this is very important for a Labview beginner.

 

regards

0 Kudos
Message 8 of 11
(3,414 Views)
The "messed up" property node and the race condition are two different issues. They are not related. The race condition is caused by your local variable. When your program is executing you can read the local variable before its value has been updated.
0 Kudos
Message 9 of 11
(3,404 Views)
thanks, but how can I fix the 'race condition ' problem in my codes? could you give me a simple sample, let me understand what's race condition error.
 
thanks again
0 Kudos
Message 10 of 11
(3,394 Views)