0

Countdown without for and while loop

Sander Sermus 1 year ago in IQANdesign updated by Thomas Moberg (System support) 1 year ago 3

Hello!

I would like to program the following in IQANdesign but seems to be difficult (or I am just rusty, been years that I needed to program anything other than Python :D) without a "for" or "while" loop:

when I push the increase button, it will increment by X%

when I keep holding the increase button for Y ms then it will increase Z%

when I push the decrease button, it will decrement by A%

when I keep holding the decrease button for B ms then it will decrease C%

I would like to keep it in Qcode, but maybe it would be better to use channels?

Best regards,

Sander

+2

Timers will probably work.

I agree with Michael. A timer with 'store value' selected. A button to increase the value, a button to decrease the value.

You can also solve this in Qcode and use a multiplication of the cycle time as the timer in a countdown .

I made an example here.

Image 3494