Technical Forum

LOGO!

Desperation

Erstellt von Zazu am 31.05.2012 21:06 (4 Antworten)

« Vorheriges Thema Nächstes Thema »
Seite 1 von 1 (5 Objekte)
  31.05.2012, 21:06
Beigetreten am: 04.03.2011
Letzter Besuch: 18.05.2013
Beiträge: 25
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (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.


Dateianhang: CountDown1.zip  (22 Downloads)

Top
  31.05.2012, 22:35
Beigetreten am: 27.12.2006
Letzter Besuch: 18.05.2013
Beiträge: 416
Bewertung:
Bewertung: Exzellent [4,35 von 5 / 20 mal bewertet]. (20) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (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
  04.06.2012, 14:37
Beigetreten am: 19.06.2010
Letzter Besuch: 27.04.2013
Beiträge: 174
Bewertung:
Bewertung: Herausragend [3,95 von 5 / 22 mal bewertet]. (22) 
Bewertung: Überdurchschnittlich [3 von 5 / 1 mal bewertet]. (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
  08.06.2012, 09:54
Beigetreten am: 04.03.2011
Letzter Besuch: 18.05.2013
Beiträge: 25
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (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
  08.06.2012, 10:18
Beigetreten am: 16.04.2012
Letzter Besuch: 14.07.2012
Beiträge: 4
Bewertung:
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
Bewertung: keine [0 von 5 / 0 mal bewertet]. (0) 
grin
Top
Seite 1 von 1 (5 Objekte)
Aktionen