LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Colour Display for Temperature Distribution

Hi everyone,

 

I am currently involved in reading a series of temperatures along a length of pipe as part of an experiment.  I thought it would be a nice touch for my VI to have a diagram of the pipe which changes colour to show the temperature distribution along it.

 

I have attached my initial solution.  I would have posted a VI snippet but this seemed to effect the my references in the property nodes.  

 

Issues

 

The code 'works' in the sense that the foreground colour of each tab control will change based on the value of the corresponding temperature.

 

  • The solution does not scale well.  I need 'n-1' case structures for 'n' colours/temperatures.  I considered using an enum input to a single case structure, but was not sure how to compare this to the for loop index.
  • Unsure whether changing a tab control background is the most efficient way to do this.  Not sure of an alternative.

I am looking for suggestions as to how to do this more efficiently as there will be up to 16 temperatures in the final system.

 

Many thanks in advance,

 

Pete


Regards,

Peter D

0 Kudos
Message 1 of 4
(4,096 Views)

Tabs are probably the weirdest choice here. Why not use e.g. a simple colorbox or button?

 

In any case, try to learn about autoindexing, it will dramatically simplify your code (see attached in yellow box).

 

I probably would use an array of clusters, each containing a colorbox and a numeric with transparent background. Modify as needed. 😉 (see attached in green box).

 

Of course you probably would want to make it a it prettier than my draft. 😉

 

For a larger ramp, I would use a plain array of flat colorboxes. Now simply index into a color ramp to generate it according to your temperatures.

Message 2 of 4
(4,081 Views)

Thank you for the quick reply.

 

The green solution solves both of my previous issues!  It is much less convoluted than what I had previously.

 

I have now read the help file for the Threshold 1D Array function as I had not used this previously.. and I also refreshed my memory about autoindexing.

 

The last thing you mention is for a larger ramp, could you elaborate?  I think I understand what you mean but I wouldn't know how to implement it.

 

Thanks again,

 

Pete


Regards,

Peter D

0 Kudos
Message 3 of 4
(4,072 Views)

Here's a quick example. Modify as needed. 😉

 

For simplicity, you could also use an intensity graph. Simply make the 1D array of temperatures into  a 2D array and feed it to an intensity graph. Change the Z color ramp accordingly.

Message 4 of 4
(4,065 Views)