07-11-2018 11:46 AM
Sorry for letting you get lost.
I attached my simplified code and the screenshot of it. My labview version is 2016.
Thanks
07-11-2018 01:06 PM
Then you need to build up your Z-array as cstorey showed you, using the index of the X and Y points to determine where to insert the value.
07-11-2018 01:46 PM
Well, as I explained, for cstorey's example, if I use that way the value inserted in Y axis loop (inner for loop) need to be updated every cycle, if you use a random number as the input, this will be fine. But in my application, that random number will be replaced by the read value in while loop in every cycle.
So if you put this example inside the while loop, the while loop won't stop until the x,y domain filled up with the same value. If you put the example outside the while loop and make the local variable read from the whole loop as the insert value then the for loop and the while loop might not synchronize with each other.
07-11-2018 02:01 PM
It sounds like your issue is that you want the Graph to update as you collect data? That should be fine, just put it inside the loop, and make sure any data you have not collected yet is initialized to NaN so that it doesn't show up on the plot.
07-11-2018 03:16 PM - edited 07-11-2018 03:17 PM
You seem to be having logic problems with how For and While loops work. Either type of loop will do what you want. If you want to see the plot update in real time then the plot indicator has to be inside the inner most loop.
Perhaps the best course of action would be for you to post your real code and we can help you implement the looping structure and plotting required.
Edit: Attached 2015 version of VI.