LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D colormap plot

Solved!
Go to solution

Sorry for letting you get lost. 

I attached my simplified code and the screenshot of it. My labview version is 2016.

screenshot.JPG

Thanks

0 Kudos
Message 11 of 15
(1,174 Views)

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.

0 Kudos
Message 12 of 15
(1,169 Views)

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.  

0 Kudos
Message 13 of 15
(1,163 Views)

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.

Message 14 of 15
(1,159 Views)
Solution
Accepted by topic author zyb1003

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.  

 

xyz_heat_map2.png

 

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.

 

 

Message 15 of 15
(1,155 Views)