boma Posted January 9, 2017 Report Posted January 9, 2017 -In Network 5, I had a timer as show. When M0.0 is set, the timer counts, every 5 seconds, then return to the count from the start point. The cycle repeats itself as such. - In the network 6, I use a counter to count the number of cycles that 5s. Meaning that after a period of 5 seconds, the counter up to 1. But I don't know how to do it, signal input CU of counter is too fast. Thanks
Bryll Posted January 9, 2017 Report Posted January 9, 2017 You might want to trigger the counter once on the rising edge. I suspect that your "pulse" is on 5 seconds and off 5 seconds, and you only want to count up when it goes from 0 to 1 ? "POS" is probably what you are looking for. POS_CNT.bmp
boma Posted January 10, 2017 Author Report Posted January 10, 2017 12 hours ago, Bryll said: You might want to trigger the counter once on the rising edge. I suspect that your "pulse" is on 5 seconds and off 5 seconds, and you only want to count up when it goes from 0 to 1 ? "POS" is probably what you are looking for. POS_CNT.bmp Thanks, POS tried, not possible, signal of timer is so fast. Timer is run 5->4->3->2->1 -> 5->4->3->2->1......,continuous, non stop
Patrix_78 Posted January 11, 2017 Report Posted January 11, 2017 Your problem is, how CPU scans the networks. T1 gets reset before network 6 is red by CPU. You could place T1 -|/|- in network 7 and use a M..,.. to reset the timer. And I'm guessing there are beter ways to do this.
pop29684 Posted January 11, 2017 Report Posted January 11, 2017 Your logic will work with a little re-arrangement: 1. Remove current rung six (NW6) and insert it somewhere before current rung five (NW5). 2. Use address T1 for the N.O. contact of the counter CU parameter. Counters (or any other logic) used to count timer pulses should always be used ahead of (before, prior to) the timer when used in the same module. I don't have a clear explanation except that I have experienced this before. I think it has to do with the execution of timers, counters, and markers. Which are all immediate - not written to a table and then read on the subsequent scan. Although if you were to place your counter in a different module that was executed after the timer module, the counter should still work.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now