LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

building xy graphs

I'm trying to build xy graphs with multiple plots in a loop. In the attach, if I cluster each element and build an array , the plot looks fine (XY Graph). If I try to do it in a loop, I get extra points added (XY Graph 2). All the xy sets dont have the same number of elements, and the loop version pads with 0s to make the inner arrays square. This doesn't happen when I do it manually. How can I make this work in a loop?

TIA,
Bill F
0 Kudos
Message 1 of 8
(3,762 Views)
The convenience of handling the data in a 2D array is offset by the padding problems in your case.

If you need to manipulate the data this way, one solution would be to calculate the individual array sizes outside of the loop, pass these in as a third array, and use "Array Subset" inside the loop to strip off the padding elements (see attached).

I can't think of a better solution offhand.

--John
0 Kudos
Message 2 of 8
(3,754 Views)
Thanks. It didn't occur to me that the padding was happening outside the loop. Im trying to make a generic vi that will plot an arbitrary number of xy data sets. I guess this is what has to be done if all the sets dont have the same number of data points

Bill F
0 Kudos
Message 3 of 8
(3,745 Views)
HI:
         我想在XYgraph 中同时显示多条曲线,具体情况如下:(参考附件)
          当外循环循环一次时,内循环执行完得到一条独立曲线
          当................第二次时,....................又得到........................
          依次得到许多独立的曲线,同时显示在XYgraph中,同一坐标下。
           
          在附件中得到的曲线其实是一条曲线,都是首尾相接,因为它是在整个循环执行完后得到的。我用很多办法试,总得不到独立的曲线簇,第一条的首和第二条的尾相连,依次类推,其实还是一条曲线。我用的LABV7.0, 请高手指导。
                    
          
                                                                                                                                                                                            谢谢!
0 Kudos
Message 4 of 8
(3,526 Views)
附件修改稿
0 Kudos
Message 5 of 8
(3,513 Views)
附件修改稿
0 Kudos
Message 6 of 8
(3,514 Views)
I am not exactly sure what you are saying...  However, I took a look at your VI and I assume you need a while loop around the case structure so you have enough time to click the 'OK' button. 

-Bob

Message Edited by B O B on 08-10-2007 02:26 PM

0 Kudos
Message 7 of 8
(3,491 Views)
hi
       谢谢你的回复,我用的是LV7.0,所以看不到你的文件。不过昨天我已经解决了问题,得到了想要的曲线。我把结果给你(附件),设定值,运行一下你就会明白我的意思了。
 
                                                                                                                                                                            谢谢!
 
                                                                                                                                                                              
0 Kudos
Message 8 of 8
(3,476 Views)