Sign in to follow this  
Followers 0
Guest fred

SLC5/04 Multiple Counter Reset

2 posts in this topic

I have about 150 counters that I would like to reset simultaneously with a single reset bit. In the past I have used 150 counter reset (RES) instructions keyed off the same reset bit (B3/0). Does anyone know of a better way to perform the reset? I tried using a file move to move zeroes into the accumulated (ACC) values, but this doesn't work because the file move doesn't recognize the starting address (C16:0.ACC) as a valid address. The counters are in a single, contiguous data file (C16:0 thru 149).

Share this post


Link to post
Share on other sites
You can do it with indirect addressing. First a start condition bit (B3:0/0) then using a Mov 0 into C16:[N7:0].ACC. You then add a 1 to N7:0 ADD N7:0, 1,N7:0, Finally a EQU block N7:0 = 146. You then reset N7:0 back to 0 and disable the start bit (B3:0/0). This logic here will take 146 scans to reset the counters or about 3 seconds.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0