Hojland Member H Join Date Oct 2006 Location Langå Posts 203 Feb 23, 2009 #1 Hey guys. How do i make a simpel cycle counter, that can count to minimum 500000 cycles. SLC5
Brownhat Member B Join Date Mar 2007 Location MN Posts 139 Feb 23, 2009 #2 Use two counter instructions. Set the preset on the first (the "ones" counter) to 1000, and trigger a count of the second (the "thousands" counter) using the .dn bit from the first, then reset the first counter.
Use two counter instructions. Set the preset on the first (the "ones" counter) to 1000, and trigger a count of the second (the "thousands" counter) using the .dn bit from the first, then reset the first counter.
Mickey Lifetime Supporting Member Join Date May 2003 Location Palmdale,Ca Posts 10,657 Feb 23, 2009 #3 Or use an "ADD" instruction ( Floating Point Destination) instead of a counter.
KP_EENG Lifetime Supporting Member K Join Date May 2003 Location Charlotte, NC Posts 205 Feb 23, 2009 #4 If you use the ADD instruction to build your counter, make sure that you use a one-shot after the trigger logic or you could get too many counts. Regards
If you use the ADD instruction to build your counter, make sure that you use a one-shot after the trigger logic or you could get too many counts. Regards
TConnolly Lifetime Supporting Member Join Date Apr 2005 Location Salt Lake City Posts 6,152 Feb 23, 2009 #5 XIC I:1/0 OSR B3/0 ADD F8:0 1.0 F8:0 GEQ F8:0 50000.0 OTE B3/1 Good for counting to 16,777,215. After that you run into resolution issues when trying to count by 1 with a floating point number.
XIC I:1/0 OSR B3/0 ADD F8:0 1.0 F8:0 GEQ F8:0 50000.0 OTE B3/1 Good for counting to 16,777,215. After that you run into resolution issues when trying to count by 1 with a floating point number.
Hojland Member OP H Join Date Oct 2006 Location Langå Posts 203 Feb 24, 2009 #6 Thanks. I used the instruction Alaric posted. It works great