DavisDeepwater
DavisDeepwater

Reputation: 33

How can I change the slider value within the while loop in each case in LabVIEW?

There are six LEDs that light up one after the other. I want to control the speed of the flashes with a slider. Unfortunately, after reaching station A, the value of the slider actually changes. I want if I change the slider while running, I can immediately notice the change in the flash of the LEDs. Anyone have any idea how this could be solved?

Block diagram

Upvotes: 1

Views: 686

Answers (3)

kosist
kosist

Reputation: 3057

Solution could me more elegant.

enter image description here

Upvotes: 1

Here is a more detailed explanation to the code of KKS: You need a second while loop to change the time of your slider immediately. If you keep one while loop only, the new value of the slider will be active only in the next iteration. You need to put your slider in the second while loop and this loop needs to run faster than your while loop which contains your LEDs. In order to connect the value of the slider in the fast while loop with your slow while loop, you can use local variables.

Upvotes: 0

KKS
KKS

Reputation: 1389

Based on your code,

  1. plz make another while loop.
  2. And then, put your slide(timer) in the new while loop.
  3. And then, connect the slide to Labview timer by using local variable.

This is an example block diagram.

enter image description here

The corresponding front panel is this.

enter image description here

Upvotes: 1

Related Questions