10-14-2009 04:02 PM
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
Solved! Go to Solution.
10-14-2009 04:47 PM
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
10-14-2009 05:34 PM
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
10-15-2009 10:23 AM
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
10-15-2009 02:24 PM
10-15-2009 02:36 PM
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
10-15-2009 02:55 PM
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
10-15-2009 03:12 PM
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.
10-15-2009 03:34 PM
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
10-15-2009 03:41 PM - edited 10-15-2009 03:47 PM
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.