gbradley
Lifetime Supporting Member
I had a misconception about how the ACC integer is written.
I've been working on a demo program with a couple of counters counting up and down.
I mistakenly thought that I could make a counter by trapping for some random number in the ACC value and then add 1 to an integer value.
I was using 4000, and my Preset was 5000, so I assumed (Big word) that the ACC value had to go by this number.
The funny thing is, It didn’t always see the ACC value that I was trapping for. About 10% of the time it missed it.
When I think about how the scan time works I guess it makes sense.
I replaced the EQU with a Done bit on the timer, and it works every time.
I've been working on a demo program with a couple of counters counting up and down.
I mistakenly thought that I could make a counter by trapping for some random number in the ACC value and then add 1 to an integer value.
I was using 4000, and my Preset was 5000, so I assumed (Big word) that the ACC value had to go by this number.
The funny thing is, It didn’t always see the ACC value that I was trapping for. About 10% of the time it missed it.
When I think about how the scan time works I guess it makes sense.
I replaced the EQU with a Done bit on the timer, and it works every time.