ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slider config

Solved!
Go to solution

hello, 

i have a slider which varies from 0 to 63 as shown in image now i want to make like it should show on front panel 0 to 504 but in background it should send 0 to 63 for example on front panel 0, 8, 16, 24, 32, 40, 48.... 504 in multiples of 8 but in background(block diagram)  it shound send 0,1,2,3,4,5,6,7......63 so it can be 0=0, 1=8, 2=16,3=24,4=32......, 63=504.. how can i do it ?

 

thank you 

0 Kudos
Message 1 of 13
(4,661 Views)

Well, how about dividing by 8 before you "send" it along?

 

That leaves you with the decision of how to handle remainders.   You've told us that (for example), 0 on the front panel maps to sending 0, 8 maps to 1, 16 maps to 2, etc.  So what do you want to do with 1-7, 9-15, etc.?

 

You also have a subtle endpoint problem looming.  You should probably have 64 size-8 *intervals* so your slider's full range should go from 0 to 511 (while you can make the scale on the display lie to suggest that it goes from 0 to 504, assuming you have a good reason for presenting things that way to the user)  Going from 0 to 504 only gives you 63 full intervals.

    If you range it 0 to 511, you can use the integer quotient and remainder directly to do the right kind of divide-by-8 mapping with equal size intervals.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 13
(4,652 Views)
Solution

FrankenChino_0-1662554809777.png

 

Message 3 of 13
(4,642 Views)

thanks but the next problem is i have other sliders in that one has 5 values 8,10,24,456,5640 on front panel and in block diagram it should be 0,9,50,118,185.. so 8 on front is 0 in block diagram, 10 is 9, 24 is 50,256 is 118, 5640 is 185.. so may be i need other solution..

waiting for replies

thank you

0 Kudos
Message 4 of 13
(4,626 Views)

@User002 wrote:

the next problem is i have other sliders in that one has 5 values 8,10,24,456,5640 on front panel and in block diagram it should be 0,9,50,118,185.. so 8 on front is 0 in block diagram, 10 is 9, 24 is 50,256 is 118, 5640 is 185.. so may be i need other solution..


So now you have a completely different problem!?

 

Use a lookup table: have your slider output (integer) values of 0-4 and use those to index an element of any array holding your desired output values!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 13
(4,612 Views)

sorry but can you show me example or link of example because i did not get you exactly.

thanks 

0 Kudos
Message 6 of 13
(4,605 Views)
Solution

Hi jeet,

 


@User002 wrote:

can you show me example


As I wrote before: use text labels for your slider and an array of your desired value!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 13
(4,589 Views)
Solution

So why exactly does it have to be a slider? Seems quite misguided and a complete waste of UI space. It's just not natural!

 

I would recommend a "ring", "radiobutton control", or similar.

 

Here's something to get you started , but solves a slightly different problem. You just need to adapt it!

 

Note that for rings, the item and values can be anything you want!

 

altenbach_0-1662663484400.png

 

altenbach_0-1662663939312.png

 

If the number of items gets too long, I would use a listbox with a scrollbar. Use a double-click event to index into an array of values.

 

Message 8 of 13
(4,532 Views)

thanks for different idea but i want to adjust it with slider so user can adjust the config easily because in other slider there are more than 600 values. 

0 Kudos
Message 9 of 13
(4,458 Views)

I managed to do it with suggestions. Now i have one last question regarding this sliders. the Same slider i which is varies from 0 to 504 configuration is done now i want to add one last functionality in it. If slider value is 0 to 63 it should jump the values by 1 and if slider crosses 63 then it should jump values by 8 then multiplication value should change from 1e-6 to 8e-6 and there is one string that should change. i tried to do it it is working but im using button and cases i dont want to use that it should select automatically. im attaching the vi in this there are two while loops which show the what i want to do and i third while loop i did it using selection button.

 

waiting for suggestions thank you..  

0 Kudos
Message 10 of 13
(4,448 Views)