LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart only one trace

Solved!
Go to solution

I want to plot multiple signals (# of signals varies) on one waveform chart with x-axis displaying the time.

I tried the example 'Variable-Time Chart XY.vi' and in principle it should work in my case. However, since the number of signals varies, wiring the 'XY Chart Buffer.vi' is tideous.

I found anyother example (one signal) on the forum and changed it to two signals, but it did not shown the second trace (see attachment). What was wrong? What will be a neat way to display multiple signals on one panel with the x-axis showing time?

 

Thanks,

 

Ryan

0 Kudos
Message 1 of 11
(3,728 Views)

Here is the sample code. Initially I built array from the two ramdom generator before sending to the display, and only one trace is shown. Now I bundle the two random signals and both signals can be displayed.

Now my questions is how to display multiple traces dynamically? For example, if I put a numeric control on the panel. The numeric control ranges from 1 to 10, corresponding to display 1, 1:2, 1:3,  to 1:10 signals. What would be a good way to implement this function?

 

Ryan

0 Kudos
Message 2 of 11
(3,719 Views)

One way to do dynamic plot selection would be to plot all channels, but make the inactive ones transparent using property nodes.

 

 

Another way would be to check out this tutorial on using different data structures:

 

http://www.lvmastery.com/tipjar2008-10-19

 

About 25% of the way into the video are some really good ideas you want to consider.

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 3 of 11
(3,714 Views)

Steve,

     Thanks. Could you please tell me which property node is for making the inactive ones transparent?

     The video tutorial you mentioned and all the others are very helpful.

 

Ryan

0 Kudos
Message 4 of 11
(3,686 Views)
You could use the Active Plot property to select the plot you want to make invisible/transparent. And then use the Visible property to switch between invisible and visible.
Message 5 of 11
(3,670 Views)

Olivia,

     I output the Active Plot property, in the above sample code and saw '1' (32-bit integer) was the output.  How do I set the number so that the two traces can be independently set on and off?

 

Thanks,

 

Ryan

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

I think I found the answer from the sample code of message 4 in this post

http://forums.ni.com/ni/board/message?board.id=170&thread.id=85386&view=by_date_ascending&page=1

 

What I need to do is for inactive signals, I will use 'NaN' instead of a out-ranged number to the figure.

 

Thanks for your help,

 

Ryan

 

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

RyanWu wrote:

Olivia,

     I output the Active Plot property, in the above sample code and saw '1' (32-bit integer) was the output.  How do I set the number so that the two traces can be independently set on and off?

 

Thanks,

 

Ryan


 

First of all, you need to change the property to write instead of read. Then, just like arrays, the active trace is 0 based so the first trace is 0, the second trace is 1, etc.
0 Kudos
Message 8 of 11
(3,651 Views)

Dennis,

     I still don't get it. I changed the Active Plot to read. But I don't know how to feed data to it. For example, if I want first trace transparent, and second trace shown, how do I send the data?

 

Ryan

0 Kudos
Message 9 of 11
(3,644 Views)
Solution
Accepted by RyanWu

You can't if it's set to read. As I said, you have to set it to write.

 

edit - please excuse the multiple images. Don't really know how that happened.

Message Edited by Dennis Knutson on 10-15-2009 02:47 PM
Message 10 of 11
(3,640 Views)