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

in allen bradley kinetix 300 drive first E31 error shows after resting drive E11 error occurs need solution to reset E11 fault code
Replies
4
Views
157
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
132
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
15
Views
300
Hi i using Kinetik 300 2097 driver control by EIP with using move absolute and incremental for motion , but i want to add same driver and motor as...
Replies
0
Views
79
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
91
Back
Top Bottom