LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Knob value increasing or decreasing

How can I know if the knob value is increasing or decreasing?

I would really appreciate your help.

0 Kudos
Message 1 of 11
(4,838 Views)

Create an event case for "Value change":

 

Knob.png

0 Kudos
Message 2 of 11
(4,823 Views)
If the current value is greater than the previous, the value is increasing. If the current value is less than the previous, it's decreasing. Pretty simple. What are doing to compare? Shift register, the event structure?
0 Kudos
Message 3 of 11
(4,821 Views)

Well the problem for me was in getting the previous value of the knob.

Can it be done using a shift register?

0 Kudos
Message 4 of 11
(4,812 Views)

Thank you for your help. I'm on it.

0 Kudos
Message 5 of 11
(4,810 Views)

@TH14 wrote:

Can it be done using a shift register?


Yes, of course! (A feedback node is even simpler though). 😄

0 Kudos
Message 6 of 11
(4,806 Views)

We haven't learned about the feedback node yet, so I prefer using a shift register.

0 Kudos
Message 7 of 11
(4,803 Views)

A minute of reading will cure you of that. 😄

 


@TH14 wrote:

We haven't learned about the feedback node yet [...]


 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 8 of 11
(4,787 Views)

@TH14 wrote:

We haven't learned about the feedback node yet, so I prefer using a shift register.


Feedback nodes work exactly the same as shift registers, they just are not necessarily attached to a loop.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 11
(4,770 Views)

Of course with a value changed event, you don't get the same value if the knob is operated by the user and the last seen boolean will stay forever.

 

With a feedback node, you get the state since last update, which if often unchanged. You can easily latch the boolean logic to simulate the event behavior though (not shown).

 

Here's code using a feedback node.

 

 

0 Kudos
Message 10 of 11
(4,758 Views)