From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set maximum value of the slide in runtime

Solved!
Go to solution

Hello,

 

I have a number of files to process, the files will be browsed in at runtime. I want to use a slider to control which single file to process at certain time. Since the total file number can not be pre-dertermined, I am wondering how I can setup the slider maximum value at runtime (after I have know how many files in the pool).

 

Any help will be greatly appreciated.

Jacie

0 Kudos
Message 1 of 9
(5,566 Views)

Create a property node and select the following property: Scale -> Range -> Maximum

 

Ben64

Message 2 of 9
(5,557 Views)

Right click on the slider on the block diagram and create a Property Node.  If you look towards the bottom of the options there is one called scale and then another sub choice called range.  Lots of options in there.

0 Kudos
Message 3 of 9
(5,553 Views)

I still didn't get this work. I am new in LabView, please help with more details.

 

I create the Property Node by right click the slider, then select the scale->Range->Maximum. After that I have a Scale.Maximum Object created in the Block Diagram, but I don't get how to set the Scale.Maximum value. Any help will be greatly appreciated.

 

Thanks. Jacie

0 Kudos
Message 4 of 9
(5,537 Views)
Solution
Accepted by topic author jacie

Right click on the property and select Change to Write.  Now you can wire a constant to the property node.

0 Kudos
Message 5 of 9
(5,532 Views)

It worked. Thanks for all that helped.

0 Kudos
Message 6 of 9
(5,527 Views)

That is the way to do it programatically, but it is easier if you just open the Properties of your slider, and modify the Data Entry values Max,Min, and the response to values outside limits, if you want a max value of 126 and the user writes something higher, setting the response to coerce will automatically change to 126. 

0 Kudos
Message 7 of 9
(3,709 Views)

Hi Alex,

 

it's nice to show that option in a 8 year old thread.

 

But unfortunately it doesn't apply to the problem of the OP: When you don't know the number of files (or any other objects) in advance then it doesn't make sense to limit the slider range at edit time!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(3,704 Views)

Oops,  that's true I haven't checked the thead date,  I was just looking for different ways to force the input slider max value,  and came to this thread. 

Maybe it is useful for someone else 😅

 

0 Kudos
Message 9 of 9
(3,701 Views)