LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Colour Values of a 3D surface

Hi,
 
I've been having a problem working with a 3D surface. I need some way to display the values represented by the different shades of colour. Im sure this question appears a lot on the forum, and I looked through a number of similar threads trying to solve my problem, but I was having difficulty. I am a co-op student who is a self-taught labview beginner, who has been using labview for less than a month, although I am learning fairly quickly there are some things that I have been having difficulty with, and this is one of them. I have a profile of a surface, where the x and y values are coordinates of data points, but the z value is not the thickness of the object, it is the amount of material that needs to be removed from the object to get it into specification. If the object is a little bit too thin (under specification) then suddenly a large amount of material needs to be removed to get it to the next specification (the specification reoccurs as a cosine function). This makes for a strange contour graph, but the areas where the object is too thin are not of immediate concern when the object is being processed, so I included an extra control to eliminate their effect on the map. My problem is that the range of values displayed by the colours of the contour map is variable, the range could be as small as 0-10nm or as large as 0-350nm. So I need a colour legend to put beside the contour map that will show the values of each colour (or, more realistically, the hue of colour related to certain numbers), but I need the legend to change based on the range of data covered, just like the shading changes on the contour map (if the range is 0-10, 0 and 10 have a large colour difference, but if the range is 0-300, 0 and 10 have almost the same colour). I have attached my vi (it actually runs as a subVI in a much larger program that I have been writing).
 
I have no idea how to do this. Any help would be greatly appreciated
 
Much Thanks 
 
Jeff
Jeff


Using Labview 7 Express
0 Kudos
Message 1 of 7
(4,021 Views)
I forgot to mention, I am using Labview 7 Express
 
Jeff
Jeff


Using Labview 7 Express
0 Kudos
Message 2 of 7
(4,012 Views)
I am also unable to figure out why my contour graph doesnt change at all regardless of the values I put into it, when I run the VI by itself, but when I link a 3D surface in another VI to the surface in this VI and run this VI as a subVI, the other surface updates just fine.
 
Thanks for any suggestions
 
Jeff
Jeff


Using Labview 7 Express
0 Kudos
Message 3 of 7
(4,007 Views)

Hi Jeff,

Here are links to two old threads.

http://forums.ni.com/ni/board/message?board.id=170&message.id=143663&jump=true

http://forums.ni.com/ni/board/message?board.id=170&message.id=160983&query.id=208821#M160983

It also sounds like the default autoscaling of the axis is affecting you.

Please take a look at those threads, follow-up here with new code if you still have questions.

Have fun,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 7
(4,001 Views)
Hi Ben, I had already taken a look at those threads, and they weren't exactly what I was looking for, but I thought more about it, and found a way to adapt my own solution from the ideas presented. Thanks a lot!
 
I ended up calculating the maximum value being displayed at any one time, and since I knew the minimum value was always 0, i was able to generate a "step" to get 12 evenly spaced values, which i assigned to 12 shades of red, and assigned those two values to the color map values and color map colors, since I used shades instead of distinct colours, I still got the effect I wanted with the surface profile. By also creating indicators, I got the dynamic legend that I wanted. I am still not entirely sure why the display in my subvi doesnt update, but that is not a huge issue.
 
Thanks again for your help,
 
Jeff
Jeff


Using Labview 7 Express
0 Kudos
Message 5 of 7
(3,994 Views)

Hi Jeff,

I am glad those links inspired you to a solution.

Could you please post an example of your solution to help those that follow in your foot steps?

Re: the update issue

Please start a new thread on that question and let some of our newer contributors help you with that. Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,989 Views)
Here is my solution (in Labview 7 Express). Anyone looking at it as a solution should take note that the contour map will not update, but the legend will (so this will give you an error), however, everything works fine as a subvi. I also disabled the map so the user cannot arbitrarily rotate it. I hope this can help anyone else with the same problem. (and Im sorry that my format is probably awful, like I said, Im new to labview, and I have been teaching myself, so I don't know the finer points of labview programming style).
 
With regards to the problem I was having with the contour map not updating, it is no longer an issue, because although I initially was using the subvi front panel as a popup window (to enlarge the view of the contour map being shown on the front panel of my main program) I decided it was unnecessary. In fact, I was getting so many errors that I didnt understand, that I had to recreate all my 3D surfaces. Now it is all working, so I'm not going to worry about the popup window: meaning there is no need for that contour map to be updating as long as the data coming from the subVI is updating (which it is).
 
Thanks a lot for your help
 
Jeff
Jeff


Using Labview 7 Express
Message 7 of 7
(3,986 Views)