LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress bar, making the value of a slider move with the slider itself.

Solved!
Go to solution

Hi guys

 

I'm using a vertical progress bar which is configured to show the peak of the reading. I would like to make the peak value be shown next to the peak (which moves).

How is this possible? I have been looking at property nodes, but I can't find the position of the slider anywhere. My progress bar has two sliders, peak and actual value.

 

 

Example: I would like the value 0.339641 to move with the red line when it changes value:

 

 

0 Kudos
Message 1 of 7
(4,428 Views)

I don't think you can achieve this by customizing the control, so if you still want this, I would suggest you use a property node to get the position, size and min/max values of the scale and use that to calculate the desired position of a separate numeric indicator (which would be your digital display).


___________________
Try to take over the world!
0 Kudos
Message 2 of 7
(4,421 Views)

Hi Teknik Kim

 

This was a funny question. It is possible to do this with the property nodes. You can get the position of the progress bar digital display by creating a property node on the progress bar and selecting the property digital display. This property is then an array of references to all the possible digital displays in your case there is only 1 meaning that you can just take out the first element of the array. If you create a new property node on this reference you can take the property "Position -> Top" and write to this depending on your value. 

 

I have created an example for you where I do the following:

 

1) Take position of Progress bar

2) Shift the position of the label so I only have the position of the fill color part.

 

Then the digital display is aligned with the top border of the fill. I would say it should be half way up so the middle of the digital display should be at the top so I:

 

3) Shift the position of the height of the digital display dividede by 2

 

Then the middle of the display is aligned with the top. But Actually I want it to be in the bottom when the value is 0 so I:

 

4) Add the value for the Height of the Fill Color Part

 

Then it is aligned nicely in the bottom and we are only needing to make it move with the value. To make this dynamic I:

 

5) Move the digital display with the (current value / maximum value) * height of fill color part

 

This seems to work nice for me, try to take a look at the attached example and see if it works for you (LabVIEW 2012)

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

Message 3 of 7
(4,394 Views)

Hi/Hej

 

Super, I will try your method right away.

 

PS: Would it be possible for you to post it in a LV 2011 VI instead? I haven't upgraded yet.

 

-Kim (FOSS Analytical)

0 Kudos
Message 4 of 7
(4,379 Views)
Solution
Accepted by teknik_kim

Hej Kim 🙂

 

Please see attached 2011 version

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 5 of 7
(4,374 Views)

Hi

 

Looks fine, thanks 🙂

 

I have, since I received your VI, made an alternative version which does the same thing. It's a bit annoying that the slider bars positions can't be read/written in pixels though.

 

-Kim

0 Kudos
Message 6 of 7
(4,343 Views)

Hi Kim,

 

Thanks for the response. I'm glad you could use and understand the code in a way so you could modify it for your needs. 🙂

 

I agree that the slider position would have been a very nice thing to have for this application. But luckely we could manage our way around it. 

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 7 of 7
(4,308 Views)