Greetings AB2005 ...
this is one of those “simple” questions that turns out to be “not-so-simple” after all ...
the original question:
Is it necessary to use OSR in the rung of counter after input instruction?
the correct answer is: “yes, sometimes it is necessary” - but not for the reason that you stated ...
Someone told to me that the counter may self count (accumulate) continuously without using OSR if input instruction is true.
no, the counter won’t accumulate continuously if you leave out the OSR ... AS LONG AS you don’t do something weird to the CU (Count Up) bit (as my distinguished colleague Alaric mentioned) ... or maybe program two or more CTUs with the same address ... etc. ... just post again and ask if you’d like more information along these lines ...
but the “too simple” answer to your question is that “no, you usually don’t need an OSR in front of the CTU instruction” ...
now let’s go deeper - for the “not-so-simple” answer ...
question (1): are you eventually going to want to “reset” this counter back to zero? ... let’s suppose that your answer is “yes” ...
question (2): are you going to use an RES (Reset) instruction to do the reset? ... let’s suppose that your answer is “yes” ...
question (3): is there a chance that the field input condition (switch, sensor, etc.) just happens to be made/true/on/active while you execute the RES instruction? ... let’s suppose that your answer is “yes” ...
question (4): would it “mess things up” if you happened to get a “false count” of 1 immediately after you finished executing the reset? ... let’s suppose that your answer is “yes” ...
well if you answered “yes” to each of those questions, then in that case, you WOULD want to insert the OSR in front of your CTU instruction ...
click here to read all about this particular subject ... it would probably be a good idea to read the entire thread - but the nugget of truth that you desire is included in Post #15 which I’ve linked above ... skip ahead to the rung comments in the last figure of that post if you want to get right to the point ...
I hope this helps ...