PLUS+1 Tools > PLUS+1 GUIDE

Up/Down Counter Step

(1/2) > >>

tjozmin:
Using the Up/Down Counter function is it possible to change the step size? Or will it only increment/decrement by 1?

Thomas:
No it is only possible to increment in steps of 1.

You could use a scale perhaps after the up/down counter.

If you highlight the up/down counter in the component tree and press F1 the manual will open, if you then click on the picture of the symbol in the manual you can see examples of how it is working.

Please let me know if you have further questions.

Quax76:
Hi tjozmin,

concerning to which functins of the up/down counter you need, you simply could program your own one.
I always use a self programed scs file in my display applications for adjusting some values. This block is also time depending. This means, the longer you hold the up/down button, the greater is the increment/decrement value.

Rafal_Typiak:
Below is a little something I cooked up on the fly when I've read your message. I won't be hold responsible if it's gibberish, as I haven't tested it (I only compiled it).


The way it 'should' work is that you use buttons 1 and 2 on the display. In my case they give out a 'true' signal as long as they're pushed. If out press on or the other than you start the generators which increment the value - thus leading to increasing or decreasing the output value respectively. You should bare in mind two things though:
1. you are limited to a output value of 255. This piece of code does not recognize an overflow - but that can be easily changed with a simple 'compare' block :)
2. it will go bananas if you press 1 and 2 at the same time (or it will just go with '1' command as it's higher on the block diagram) - but that can also be changed.

Thanks to w nice compiler, the start values are always set to 0 at the beginning of the program loop, so you don't have to worry that you'll get some crap at the beginning. But if you want to be extra sure, you can alway force all values to 0 at the first program loop.

Be aware that this is only a simple demonstration of how it can be done. Now depending on what you really want from it, is should be changed accordingly. For example you would want the counter to return to value '1' after you release the button. And so on. Hope it helps you.

Best regards,
Rafal

BetterAdapted:
try this - do prime your control value




Images are getting resized here!

http://i1094.photobucket.com/albums/i455/BetterAdapted/Image1.gif



Navigation

[0] Message Index

[#] Next page

Go to full version