LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design a depth scale for GUI

Solved!
Go to solution

@Yamaeda wrote:

If you change the scale.min and scale.max and keep the needle in the middle (or just a fixed graphical needle) you'd get a similar effect.


Take a look the image, when depth approaching 0, needle is not in the middle of scale.min and scale.max.

Unless you allow negative depth.

 

George Zou
0 Kudos
Message 11 of 20
(960 Views)

@LLindenbauer

when customizing what? The vertical slide bar? There is no option in that to replace the pointer. Kindly clarify this. And yes i don't plan it to change it in the future so a quick way would be the best

 

 

0 Kudos
Message 12 of 20
(944 Views)

@zou

How do I move the whole control up/down and not just the scale? And what control are you talking about? Please explain in some more detail as I'm only a beginner to labview

 

I've attached a vi, this is the length and marker width that i need.

0 Kudos
Message 13 of 20
(944 Views)

@yameda

 

Where are these scale.min and scale.max options in labview?

 

The inputs to the Draw Scale vi are to be inputted once while designing (as shown in the vi attached to my previous reply), how do i change those?

0 Kudos
Message 14 of 20
(941 Views)

@sarwatsarfaraz wrote:

@zou

How do I move the whole control up/down and not just the scale? And what control are you talking about? Please explain in some more detail as I'm only a beginner to labview

 

I've attached a vi, this is the length and marker width that i need.


I can't open your VI.  I'm using 2018.

 

There is an example: Vertical Scrollbar.vi

It's installed on your computer with LabVIEW.

It moves all the controls in a cluster up and down.

 

George Zou
0 Kudos
Message 15 of 20
(905 Views)

@sarwatsarfaraz wrote:

@LLindenbauer

when customizing what? The vertical slide bar? There is no option in that to replace the pointer. Kindly clarify this. And yes i don't plan it to change it in the future so a quick way would be the best

 

 


Sorry, I can't show you the details with screenshots right now - I'll try my best using words and links.

 

First, use a graphics tool to make your depth scale, like so:

 

LLindenbauer_0-1665069136666.png

Then add a slide to your vi and open the control editor. Switch to customize mode LLindenbauer_2-1665069332024.png https://www.ni.com/docs/en-US/bundle/labview/page/lvconcepts/custom_cont_ind_type.html#d110e62

 

Note that you are able to select the different parts of the control:LLindenbauer_4-1665069488875.pnghttps://www.ni.com/docs/en-US/bundle/labview/page/lvconcepts/custom_cont_ind_type.html#d110e200

 

Copy the scale to the clipboard, then right click on the "Slider" element and select "Copy from Clipboard". Add a simple decoration (e.g. a box or arrow) around the midway point of the control to indicate the current depth. Put some more decorations over the slide to hide the unused portions of the new sliding scale.

 

If you save this control, the new scale moves around and the new needle will stand still. Now you have to line up the values you enter into the control with the values displayed on the needle. Depending on how accurate you want that to be, there are various methods. To keep it super simple, take a few readings of the control to get pairs of x_set and x_displayed and set up a linear fit to give x_set = x_displayed * k + d. Solve for k and d, put the formula into a subVI and connect x_set to the slide indicator. You could also do some tricks with using the pixel size of the elements. The physical style of indicator is not very precise in the first place, so that may be good enough.

0 Kudos
Message 16 of 20
(876 Views)

It takes an artist to create some of these, but you can Google labview cockpit controls to see exactly what is possible with LabVIEW front panels.  I'm sure that, next to these, yours should be relatively simple to create.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 20
(867 Views)

This seems doable but I'm having some problems while doing this:

 

1.  I am entering the control editor mode by right-clicking on the scale > advanced > customize (shown in 'control editor img.png'). Then I only have the scale in the control editor not the slide, I have to drag the 'slide' on it. I can also not select the different parts of the control in the control editor. Are you opening the control editor by a different method so that you're able to select the different parts of control?

 

2.  I can 'Copy to Clipboard' the scale, but when I right click the slide, there is no option of 'Copy from clipboard'. Probably because I've dragged the slide from the Front Panel to the control editor window. (shown in 'can't copy from clipboard.png')

 

3.  What exactly do you mean by control? The scale or the slide or the whole vi?

 

0 Kudos
Message 18 of 20
(819 Views)

Please ignore my previous questions, I figured out the answers to them (edit time has expired)

 

I cannot replace the slider element with the scale as you're telling. the slider element is being replaced with some weird object.

 

I've attached the pictures below

Download All
0 Kudos
Message 19 of 20
(807 Views)
Solution
Accepted by topic author sarwatsarfaraz

@sarwatsarfaraz wrote:

Please ignore my previous questions, I figured out the answers to them (edit time has expired)

 

I cannot replace the slider element with the scale as you're telling. the slider element is being replaced with some weird object.

 

I've attached the pictures below


That might result from trying to insert a vector image. These sometimes behave differently.

Here's how I imagined it:

First, I snipped your scale as a bitmap and inserted is an image (this is optional but having it in the same place makes it easer to show). I copied it again from there (Copy to Clipboard). Then, I select the slider element and "Insert Picture from Clipboard".

LLindenbauer_2-1665393714069.png LLindenbauer_1-1665393670893.png

This replaces the needle with the moving scale. Make the element at least as tall as the new scale. Then add the static elements - the new needle and a screen to hide the unused part of the slide.

LLindenbauer_3-1665394042488.png LLindenbauer_4-1665394140544.pngLLindenbauer_5-1665394506346.png  LLindenbauer_6-1665394534465.png

 

Now you are ready for a test drive of the submarine. The element is quite tall, but you can hide it inside a cluster to make it easier to handle.

 LLindenbauer_9-1665395438384.png LLindenbauer_10-1665395529951.png

 

Have Fun!

Message 20 of 20
(795 Views)