02-26-2024 11:29 PM
I am new to Labview, please help me in generating a Labview Block Diagram for the following task - We have a knob which can rotate 360 degrees and there is no locking you can rotate it as much you want. So this Knob is our control and we have 0 to 1000 as our limits for one rotation of knob. But after one rotation in positive direction it should count after 1000 and after two rotation it should count after 2000 and in this way we can rotate it till the value 20000 and even if we try to rotate it further it will only show 20000. Similarly if we move it in negative direction it should reduce the value and with each rotation in negative direction it should deduct 1000 from previous value and in this way it can reach a minimum of -2000 as a value. And we have to show these values in an numeric indicator. Also it should run continuously so try using loop.
Solved! Go to Solution.
02-27-2024 01:03 AM
We can help better if you show us your code with the knob. Who wrote it? How is it implemented?
Most likely, all you need an "in range and coerce" applied to the value.
02-27-2024 11:13 PM
I only wrote the code, knob has lower and upper limits of 0 and 1000 but on continous rotation it should show values upto 20000 and -2000.
I am taking modulus of values coming from knob and then checking if its greater than 500 or less than 500 for getting rotation direction of knob, then adding and subtracting 1000 for different cases to get values between -2000 to 20000
02-28-2024 10:15 AM - edited 02-28-2024 10:22 AM
Sorry, pictures of code are NOT code. We cannot run, debug, edit, or test pictures! Please attach your VI!
Nobody here will waste their time to recreate code from a picture. If you don't help us, we cannot help you. Seriously!
Why do you have two pointless coercion dots?
02-28-2024 10:43 AM
@altenbach wrote:
Sorry, pictures of code are NOT code. We cannot run, debug, edit, or test pictures! Please attach your VI!
It seems to be that Spectra235 needed kind of "multiturn" knob, you already answered the similar question twenty years ago - https://forums.ni.com/t5/LabVIEW/How-can-I-create-a-knob-that-I-can-turn-multiple-times/m-p/135167#M...
Something like that may be:
Hope it helps
02-28-2024 11:07 AM
Since we are dealing with integers here, here's what I would do:
Modify as needed....
02-28-2024 11:40 AM
Yes exactly like that, thanks so much for helping me out. I am very new to Labview as I used to code in C++ and sorry I forgot to share my VI.
Thanks a lot.
02-28-2024 11:45 AM - edited 02-28-2024 12:03 PM
@Spectra235 wrote:
Yes exactly like that, ....
We don't know which post you are replying to. You can mark the relevant post as solution instead.
(While both version as based on my code, my blue solution above is significantly simpler and easier to maintain (all flat code, nothing hidden in cases, all integers, etc.)