S7-300 - increment 16, decrement 1 counter?

PaddyClarke

Member
Join Date
Sep 2023
Location
Manchester
Posts
5
Hi,
I have a stand alone inspection unit with no PLC but I can send 24v input signals to the machine PLC to show a good read and a bad read when products are inspected.

I have 2 inputs, I0.0 for a ‘Bad read’ and I0.1 for a good read from the inspection unit.
Rather than reject every ‘bad read’ I want to allow all inspections to pass through but have a serial check running where the machine will stop if the amount of rejects are excessive so the operator can visually inspect.

I would like the code to do the following:

For every bad read, I0.0 I want a counter to increment by 16 and for every good read, I0.1 I want the same value to decrement by 1. So this value will continually be going up and down depending on good and bad reads. When the value reaches 200 I want to use a memory bit M1.0 to insert into the stop rung for the machine.

Any advice on the best type counter to carry out this operation would be appreciated.
Thanks.
 
That works well, however how can i prevent the count value from going negative?
The value would count down to zero as 99% will be 'good reads' , sit there at zero until a 'bad read' occurs where it increments to 16 or beyond and counts again as normal. If it goes negative it would take many 'bad reads' to reach the 200 cut off value.
 
Should be Greater or equal to zero and I'd put it after the pos edge instruction.


I did think about it and the difference would be minimal, but I agree, although it was easier to modify the JPEG by putting it in front of the edge detector.
 

Similar Topics

Hey all, first time poster here. I am wondering if anyone has tried using a Keyence SR-X300 barcode scanner to a Micrologix 1400. Keyence sent...
Replies
0
Views
34
Hi Siemens guys! I am experiencing SF fault on our S7-300 (6ES7 315-2AH14-0AB0) CPU from time to time. I've checked the diagnostic buffer and...
Replies
13
Views
174
Have a system that has been running for over a year and all of a sudden getting a ExcessiveVelocityFault on one of the drives when the MSO command...
Replies
2
Views
144
Hello PLCS.Net Forum, First time posting. Let's assume I am a novice. BASIC PROBLEM: My servo/linear piston is no longer zeroed to the...
Replies
9
Views
218
hi... i have an issue in s7 300 plc, while we run the machine(in idle there is no fault) , plc cpu goes in SF mode, after restart the power cycle...
Replies
2
Views
117
Back
Top Bottom