Technical Forum

LOGO!

Desperation

Thread Starter: Zazu   Started: 5/31/2012 9:06 PM   Replies: 4

« Previous thread Next thread »
Page 1 of 1 (5 items)
  5/31/2012, 9:06 PM
Joined 3/4/2011
Last visit: 5/18/2013
Posts: 25
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I am tearing my hair out trying to get through this and have just about admitted defeat. I have enclosed a small program for a decremental counter. I am using the analog blocks to try and get a value from the counter block as a reference. At the moment I can count down to zero from any figure I input using F1 and F2 then the counter resets and pauses before starting again after a hard reset. The problem is I need to input very high numbers, as high as 31000. Does anyone know of an easy way to get a referenced value into the counter from either BCD thumb wheels or even a potentiometer. I will be forever in your debt if you can help me in any way.


Attachment: CountDown1.zip  (22 Downloads)

Top
  5/31/2012, 10:35 PM
Joined 12/27/2006
Last visit: 5/24/2013
Posts: 417
Rating:
Rated: Excellent [4.35 out of 5 / rated 20 time(s)]. (20) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
The max value of a counter etc is 2^15 -1 = 32767.
If you want higher counts then youn have to divide the value.
You can use a couter counts to 10, and then a ful counter to max 32767, then you count to 327670
Top
  6/4/2012, 2:37 PM
Joined 6/19/2010
Last visit: 5/23/2013
Posts: 174
Rating:
Rated: Outstanding [3.95 out of 5 / rated 22 time(s)]. (22) 
Rated: Above avarage [3 out of 5 / rated 1 time(s)]. (1) 
Zazu wrote:
I am tearing my hair out trying to get through this and have just about admitted defeat. I have enclosed a small program for a decremental counter. I am using the analog blocks to try and get a value from the counter block as a reference. At the moment I can count down to zero from any figure I input using F1 and F2 then the counter resets and pauses before starting again after a hard reset. The problem is I need to input very high numbers, as high as 31000. Does anyone know of an easy way to get a referenced value into the counter from either BCD thumb wheels or even a potentiometer. I will be forever in your debt if you can help me in any way.



You can try this trick for large values,

1. Divide your digits in two or more, let say your preset value has 6 digit (e.g 999999) on this case split the values to be counted on two counters;On Counter1 digit 1 to 4, AND on Counter2 digit 5&6.

2. The count set pulse for Counter2 is from your sensor (BCD thumb wheels or  potentiometer).
3. The count reset pulse for Counter2 is when the value reaches 9999.
4. The count set pulse for Counter1 is the reset pulse for Counter2.

Hope this helps if my explanation is not clear for you I may post you a sample program.

Regards,

You like it? Rate it !


ለማንኛውም የፋብሪካ አውቶሜሽ ስራ፣ በተለይም፡

ፒ. ኤል.ሲ፣ድራይቭ፣ኮምፒዩተራይዝድ ማሽን ስራ፡በዚህ ይደውሉ 0922 493737
Top
  6/8/2012, 9:54 AM
Joined 3/4/2011
Last visit: 5/18/2013
Posts: 25
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Thank you very much for the replies. I have the counter working, it's actually getting the start value into the program that I'm struggling with.
Top
  6/8/2012, 10:18 AM
Joined 4/16/2012
Last visit: 7/14/2012
Posts: 4
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
grin
Top
Page 1 of 1 (5 items)
Actions