LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

increase to a value then decrease

Solved!
Go to solution

if I initial x = 0.

 

I want to increase x++ to x=10, then I want to decrease x-- back to 0.

 

 

0 Kudos
Message 1 of 15
(4,393 Views)

What is this for?

 

Do you know anything about loops or arrays?

 

Have you written any code yet?

0 Kudos
Message 2 of 15
(4,383 Views)

I want to emulate the LED chase effect on LabVIEW.

 

I tried to use "case" but I have problem with "default".

Then, I tried to create 2 while loops, 1 for increment and 1 for decrement but i couldn't make the variables connect between two loops. Furthermore, it doesn't what i want.

 

 

0 Kudos
Message 3 of 15
(4,375 Views)

Oh, althought I has been studying labVIEW not for a long time, I think i know how to use loops, arrays, clusters.

0 Kudos
Message 4 of 15
(4,373 Views)

This has two ways of doing it.  At top, the easy way.  At bottom, the really easy way.

 

 

0 Kudos
Message 5 of 15
(4,372 Views)

Here's one a bit more complex but it gives you more control over the limit of loops.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 15
(4,368 Views)
Solution
Accepted by blacksnow

Surely we can make it prettier than that.

Message 7 of 15
(4,363 Views)

Thank you for super fast reply code.

 

I am new, so I am afraid that I will make you guys mad with my questions :D. Please bear with me.

 

But as I am trying to emulate the led chase effect, that mean the code has to be iterated forever, (except when pressing stop).

So, my question is: Is there a way to loop your codes forever, that means: the variables go back and forth between 0 and 9?

 

And, of course, I am trying to solve this problem, too.

0 Kudos
Message 8 of 15
(4,354 Views)

Take any of these solutions and put it inside a loop.

 

If you want it to go forever, I'd use a while loop and set the condition to "continue if true" and use a constant false.

 

Can you give it a try and post what you come up with?

0 Kudos
Message 9 of 15
(4,349 Views)

Thanks,

LandBelenky's code is what i need.

I learnt a lot from you guys codes.

0 Kudos
Message 10 of 15
(4,348 Views)