![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Lifetime Supporting Member
|
CTU reset question
I haven't come across this before. I am trying to understand why the counter doesn't reset to 0, when the .dn is true? It immediately puts a 1 in the .acc instead of the desired 0. I am assuming it has to do with the asynch scan and triggering the counter at the same time that .dn goes true is what is doing this?
Capture.PNG |
![]() |
![]() |
#2 |
Member
![]() ![]() Join Date: Jan 2022
Location: Atlanta
Posts: 57
|
I bet it put a zero, but it most likely incremented again. Place a rung after the reset to catch the ACC, if ACC = 0 then latch a test bit. You could place a one shot after the input or only allow reset when the input is low/off.
|
![]() |
![]() |
#3 |
Lifetime Supporting Member
![]() ![]() Join Date: May 2017
Location: Michigan
Posts: 521
|
The RES does reset the counter to 0. It just also resets the .CU bit of the counter.
As such the counter does not 'remember' that it already counted, and, since the input is still true, it counts up to 1 when it scans on the next scan cycle. Nothing to do with the asynchronous scan, that could only be relevant if we are looking at the input being referenced in multiple locations. You can prevent this from happening by putting your own one-shot after the input, separate from the counter's internal one-shot (the CU/CD bits) |
![]() |
![]() |
#4 | |
Lifetime Supporting Member
|
Quote:
|
|
![]() |
![]() |
#5 |
Lifetime Supporting Member
|
I'm pretty sure that if the logic preceding the counter is true when the reset occurs, it will count to 1
|
![]() |
![]() |
#6 |
Lifetime Supporting Member
|
exactly. See this link and this link to understand what is happening; pay particular attention to .CU, which is one of the status bits affected by the RESet instructions.
Other approaches:
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; January 15th, 2022 at 01:12 PM. |
![]() |
![]() |
#7 | |
Lifetime Supporting Member
![]() ![]() Join Date: May 2017
Location: Michigan
Posts: 521
|
Quote:
EDIT: My apologies, by 'one-shot' I meant ONS not OSR. OSR would work but would require additional logic. See this technote: ONS is Rockwell's recommended solution to the issue. Last edited by plvlce; January 15th, 2022 at 01:14 PM. |
|
![]() |
![]() |
#8 |
Lifetime Supporting Member
|
Exactly. I don't have RSL500 nearby to play with but I wonder something similar to this would work with that s-ware, since the scan is synchronous (last rung wins)?
|
![]() |
![]() |
#9 |
Lifetime Supporting Member
![]() ![]() Join Date: May 2017
Location: Michigan
Posts: 521
|
As has already been stated, this has nothing to do with the scan being synchronous or asynchronous. This issue occurs across all AB software (5, 500 & 5000) using CTU/CTD counters and is an effect of the RES resetting the counter's internal oneshot.
|
![]() |
![]() |
#10 |
Lifetime Supporting Member
|
|
![]() |
![]() |
#12 |
Lifetime Supporting Member
![]() ![]() Join Date: Dec 2020
Location: Missouri
Posts: 137
|
My head is still spinning from being bitten off the time I suggested that this issue is a persistent 'bug' with multiple AB CPUs - so I won't dream of suggesting it again. I think I was chewed on for a couple of days by the AB faithful.
The reset instruction resets the bit that is used as a history for rising edge detection of the counter input. The next scan after the reset is interpreted as a new rising edge. Apparently it's not a bug - it's a feature. You paid for it. |
![]() |
![]() |
#13 |
Lifetime Supporting Member
|
|
![]() |
![]() |
#14 |
Lifetime Supporting Member
|
Interesting, because that has worked for me in the past (i.e. [MOV 0 blah.ACC]).
__________________
i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; January 15th, 2022 at 02:40 PM. Reason: Fix typo |
![]() |
![]() |
#15 |
Member
![]() ![]() Join Date: Nov 2005
Location: Buffalo, NY
Posts: 523
|
Do a search. Ron, as always, has a great post about this.
|
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Micro 850 Accumulator reset | Jody Collins | LIVE PLC Questions And Answers | 0 | February 8th, 2017 10:20 AM |
Mitsubishi Beginners question - System Reset | DecrepitDragon | LIVE PLC Questions And Answers | 4 | June 1st, 2015 10:06 AM |
Mitsubishi F1 series counter question. | Tharon | LIVE PLC Questions And Answers | 4 | March 5th, 2015 04:48 PM |
Manual vs. Automatic Reset | jrexrode | LIVE PLC Questions And Answers | 14 | January 20th, 2015 05:49 PM |
RSLinx and yellow question marks. | johnmac | LIVE PLC Questions And Answers | 2 | October 14th, 2014 12:32 PM |