LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Incrementally increasing integers over a user-defined time period

Solved!
Go to solution

Hello, I am a Labview noob with a bit of programming experience. Can anyone tell me how I can make a program that increments a user-defined value over a time period that the user also specifies, reaches the maximum value, and then decrements back to zero? For example, the program starts at 0, increments by a value of 1, waits 3s, then increments again, until it reaches a max value of 10. I've checked other posts here on related topics and ran this VI, but I do not know how to adapt it for my need. 

 

I am using Labview 2019 SP1

0 Kudos
Message 1 of 7
(268 Views)

Hi Hobo,

 


@InfamousHobo wrote:

For example, the program starts at 0, increments by a value of 1, waits 3s, then increments again, until it reaches a max value of 10. I've checked other posts here on related topics and ran this VI, but I do not know how to adapt it for my need. 


All you need to change is the wait time in that VI from 500ms to 3s…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 7
(253 Views)

Hi Gerd, thank you for the input. I did that, but the counter just switches from the base value, to the max value, then goes back to the base one. Ideally, if the base value is 0, I want to see the counter go 1,2,3,4,5...etc. until it reaches the max, then count back down. Is there a way to make that happen?

0 Kudos
Message 3 of 7
(247 Views)

I've tested the VI from your post and it is working fine.

 

Can you post your modify VI then we can have a look?

0 Kudos
Message 4 of 7
(212 Views)

Here it is, sorry for the delayed answer. I am trying to figure out how to make it "hang on" to an incremented value for a set amount of time. When I run it now, it increments immediately to the highest value and returns to the lowest, also immediately. I want to make it increment and decrement more slowly if that's possible.

0 Kudos
Message 5 of 7
(183 Views)
Solution
Accepted by topic author InfamousHobo

You have an issue with your cabling for High and Low.

By arranging the cabling the function is going up and down as intended.

Please be aware that the T_Low as to be equal or greater than your load when starting the program or it will not react well. The same goes if you change the T_Low, it has to be Lower or equal to your current value otherwise you will experience bad behaviour.

 

highLow.png

Message 6 of 7
(174 Views)

You are right! Switching T_high and T_low fixed the issue. Thank you!!!

0 Kudos
Message 7 of 7
(170 Views)