Sign in to follow this  
Followers 0
Jan

S5 and counters.

2 posts in this topic

Hallo all, I have programmed a counter. On the input is a gate with is timed for a 1 sec. input. I also apply pulses to this gate. (0 to 10 Hz approx.) The counted pulses are send to DB2 DW0. How do i mannage to read only the value after this second , and not see the counter counting up? Thanks in advance. Jan

Share this post


Link to post
Share on other sites
Long time since I played with S5, all S7 now. I think something like this would work. I believe (if I remember right) you need to use LD C1 and not L C1, the number format is different. A -1_SEC (Whilst counting jump over) JC OVER LD C1 (When not counting load value into DB2 DW0) C DB2 T DW0 OVER: A -1_SEC (Create a 1 shot on the 1 SEC starting) AN -R_One_Shot = -Reset A -1_SEC = -R_One_Shot A -Reset (Use one shot to reset counter) R C1 A -1_SEC (Count your pulses) A -Pulse CU C1 I used to use S5 a lot and to be honest very rarely used a counter, was always better to increment a flag word or data word, most programmers I knew were the same.

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