Author Topic: Up/Down Counter Step  (Read 15456 times)

Offline tjozmin

  • PLUS+1 Developer
  • ***
  • Posts: 10
  • Karma: +0/-0
    • Oxbo International Corporation
Up/Down Counter Step
« on: October 13, 2010, 06:45:56 PM »
Using the Up/Down Counter function is it possible to change the step size? Or will it only increment/decrement by 1?

Thomas

  • Guest
Re: Up/Down Counter Step
« Reply #1 on: October 21, 2010, 02:32:55 PM »
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

  • Guest
Re: Up/Down Counter Step
« Reply #2 on: November 03, 2010, 11:03:49 AM »
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.

Offline Rafal_Typiak

  • PLUS+1 Expert
  • ****
  • Posts: 51
  • Karma: +1/-0
Re: Up/Down Counter Step
« Reply #3 on: November 10, 2010, 09:47:37 AM »
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

  • Guest
Re: Up/Down Counter Step
« Reply #4 on: November 19, 2010, 01:24:50 PM »
try this - do prime your control value




Images are getting resized here!

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



« Last Edit: November 19, 2010, 03:02:05 PM by BetterAdapted »

Offline Stefan

  • Administrator
  • PLUS+1 Expert
  • *
  • Posts: 73
  • Karma: +0/-0
Re: Up/Down Counter Step
« Reply #5 on: November 19, 2010, 03:53:33 PM »
Hello,

This version has got a preset function (can also be used as reset of course).




Best regards
Stefan

BetterAdapted

  • Guest
Re: Up/Down Counter Step
« Reply #6 on: November 22, 2010, 09:53:43 AM »
thats what my real one looks like - i apply signed adjustment values - lol - wanted to keep it simple - Used on deadband control system

jsaluk

  • Guest
Re: Up/Down Counter Step
« Reply #7 on: November 25, 2010, 06:45:37 PM »
To get an output with steps larger than 1, I multiply the count by the step amount.  For example, when I want steps of 10, I multiply by 10.  Good for setting rpm, valve currents etc where small steps are of little value