Posted 25 Jan 2006 (edited) Wrote a formula to count or try to count past the number 32767. Trying to keep track of cycles between rebuilds. Attached a copy of the formula, will this work. Or is there a better way? Edited 25 Jan 2006 by Brad Share this post Link to post Share on other sites
Posted 25 Jan 2006 Why use the counters at all. Can't you ADD 1 to your float file instead of counting up Share this post Link to post Share on other sites
Posted 25 Jan 2006 Just used the counters because they are already in the program. Share this post Link to post Share on other sites
Posted 25 Jan 2006 (edited) Here's another brute force method. This should tell you over 1 billion served Just noticed that my program is for a slc 5/04 not a 1200! The one shots are different (aren't they????) Edited 25 Jan 2006 by brucechase Share this post Link to post Share on other sites
Posted 25 Jan 2006 (edited) how about this? ... I think this is what Wordman had in mind ... and yes, the OSR is an ONS in the 1200 ... Edited 25 Jan 2006 by Ron Beaufort Share this post Link to post Share on other sites
Posted 25 Jan 2006 (edited) You are already using a floating point number F8:5 in rung 44 for the final result so just ditch the extra rungs, the extra multiply statement, and just use a one shot add and create your counter with a single rung of logic as shown here. I've alternately shown a counter using a long L integer. The ML1200 has long 32 bit integers avalable in L files. By using a 32 bit long (L) integer you can count to over 2.1 billion. A floating point counter will begin to loose precison at about 16 and a half million counts. While the processor supports a floating point number much larger than that, you no longer are able to resolve a value of one and at that point adding just one to F8:5 will no longer increase its value. Its not my intent to launch in to a long diatribe why that is so with single precison floating point numbers (something for you tor research if you really want to know) but rather I just wanted you to be aware of it. (try this sometime: Enter 16777230 into a floating point register and try adding 1 to it with an add instruction) Use a compare instruciton istead of a DN bit if needed. Edited 25 Jan 2006 by Alaric Share this post Link to post Share on other sites