LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

custom control represent switch

Solved!
Go to solution

I'm trying to represent a switch in LabVIEW using a dial. However, I can't figure out how to customize my control to look the way I want. I would like it to have options like below

 

 

/

_

 

\

 

So, I inverted the numbers on my dial so the needle goes counter-clockwise. Then I got rid of all "decorations" so it doesn't look 3d, just flat. But, if I set the maximum to 3 it puts the three around the 7 o'lock position by default. I essentially want the three to be at the 1 o'clock position. So my next step was to make the maximum go up to 10 and hide the numbers past three. But, if I do that, the user still has the ability to set the control past 3. How do I get this working?

 

Thanks.

0 Kudos
Message 1 of 12
(1,902 Views)

Have you specified the limits in the Data Entry Menu and selected coerce?

Message 2 of 12
(1,889 Views)

Like this?

16987iCE8584B7132F2A3E

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 3 of 12
(1,884 Views)

Should have been more clear. I'm using a Gauge which does not have the data entry tab in it's properties dialog. Tim your solution doesn't quite line up right if I add more switches. Maybe I will try customizing the knob and use Darin's solution. More suggestions?

0 Kudos
Message 4 of 12
(1,873 Views)

 


@for(imstuck) wrote:

Should have been more clear. I'm using a Gauge which does not have the data entry tab in it's properties dialog. Tim your solution doesn't quite line up right if I add more switches. Maybe I will try customizing the knob and use Darin's solution. More suggestions?


I've attached a VI that lines up pretty well.  Drag the 2 around to change the endpoints.  Obviously, you can change the number (2) to however many switches you want. 

I was playing with the max set at 5, and I liked the result.  Maybe I'm still misunderstanding what you want though..

--
Tim Elsey
Certified LabVIEW Architect
Message 5 of 12
(1,864 Views)

Gonna have to make it 8.5

 

However, I have a solution. I customized the gauge went into edit mode and copied the needle to the clipboard. Then opened the knob and edited that, copying the gauge needle over the default knob needle.

 

After that, I resized the "large" part of the knob and to the same size of the "knob" on the gauge. Now it looks just like the gauge but I have the ability to use Darin's suggestion in the properties dialog. I coerced to my limits and voila. Works.

0 Kudos
Message 6 of 12
(1,859 Views)

You could probably saved yourself some work and just used text labels set to 1,2,3. No need to coerce anything.

Message 7 of 12
(1,852 Views)
Solution
Accepted by topic author GregFreeman

Apparently I need two characters to post.

--
Tim Elsey
Certified LabVIEW Architect
Message 8 of 12
(1,850 Views)

@Dennis Knutson wrote:

You could probably saved yourself some work and just used text labels set to 1,2,3. No need to coerce anything.


That's kinda my fault. I tried them and they weren't working quite how I wanted and I got tired of fooling around with them. Anyways, I'll try this and remark the solution when I find the easiest way. Can I have a text label example, I'm still struggling.

0 Kudos
Message 9 of 12
(1,847 Views)

Once i figured out how to rotate the control and "squeeze" the numbers in customize mode, I got it. It just took some playing around with my mouse. Thanks Tim

 

 

0 Kudos
Message 10 of 12
(1,833 Views)