LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Confusing error with 3D surface

I have written a subvi that takes in a cluster of values (some of which are not needed in this particular subvi) and creates a contour map of a surface. Since one of the functions of the main program is to determine all the coordinates of the points on the surface, the range of data points is unknown and so the legend can not be constant. I created a dynamic legend where the colours are constant, but the values change depending on the range of data being displayed. This works perfectly except in one case. If the surface is perfectly flat (no depth in the z axis) the colours are wrong. The profile is correct, but the colours corresponding to the values are incorrect. In the pictures I attached Problem1 is the correct
profile, but the colour is incorrect, it should be black. Problem2 is correct. I believe that my problem is somehow related to the ColorMapValues and ColorMapColors properties. Does the color on a 3D surface adjust so that the middle of the range of values in the z axis (in the problem case, this would be 0) is set to the middle color in the colormapcolors regardless of the color map values? I can't figure out why the colors are not corresponding to the colorMapValues and ColorMapColors like I expected they would.
 
Any help would be greatly appreciated. I have attached my subvi in the form of a vi (all inputs have been changed to constants).
 
Thank you
 
Jeff
 
Jeff


Using Labview 7 Express
0 Kudos
Message 1 of 3
(2,467 Views)
does anyone have any idea what the problem is?
 
Jeff
Jeff


Using Labview 7 Express
0 Kudos
Message 2 of 3
(2,443 Views)
Ok so after some thought and some playing around, I solved the problem. The issue I was having is in fact with the ColorMapValues and ColorMapColors. If I passed in an array of 3D data that had depth in the z axis, the color scale adjusted so that the darkest color corresponded to the minimum value, and the lightest colour corresponded to the maximum value. If the array had no depth (z axis values
were all identical) then that value was assigned to the middle color, regardless of the ColorMapValues. Once I realized this, it was not difficult to solve. I changed my dynamic legend so that instead of going from 0 to the maximum z axis value passed it, it ranged from the
minimum value to the maximum value. I had to introduce a case structure in the even that all the z values are the same (because then there would be no range, and this would create an error in the ColorMapValues node). If all the z axis values were the same, I simply centered the legend of them, and arbitrarily incremented and decremented by 1 in both directions. This way, although the displayed image didnt change, my legend now shows the correct values. I have attached my fixed vi for reference of anyone who experiences the same problem (or a similar one). In the vi, the input (and output) cluster has values that are not used by this vi, this is because this vi is part of a much larger program. You may find that the contour map does not update on the front panel. but if you use this vi as a subvi, and wire a 3d surface to it, that surface will update.
 
 
Jeff


Using Labview 7 Express
Message 3 of 3
(2,426 Views)