09-07-2022 06:58 AM
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
Solved! Go to Solution.
09-07-2022 07:26 AM
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
09-07-2022 07:46 AM
09-07-2022 08:29 AM
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
09-07-2022 08:46 AM
@jeet4230 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!
09-07-2022 08:56 AM
sorry but can you show me example or link of example because i did not get you exactly.
thanks
09-07-2022 09:57 AM - edited 09-07-2022 09:57 AM
Hi jeet,
@jeet4230 wrote:
can you show me example
As I wrote before: use text labels for your slider and an array of your desired value!
09-08-2022 01:51 PM - edited 09-11-2022 10:32 AM
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!
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.
09-16-2022 03:06 AM - edited 09-16-2022 03:08 AM
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.
09-16-2022 04:00 AM - edited 09-16-2022 04:01 AM
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..