Siemens S7-200 to S7-1200 Counter reset

BryanG

Member
Join Date
Feb 2005
Location
Manchester
Posts
1,970
Having a 'Blonde' moment here. I am converting a program from S7-200 to S7-1200 and I can't figure how to reset a counter that is in one FC from another FC.
Below is a counter in S7-1200, I know it has a reset input, but I don't want to reset it here:

attachment.php



I want to reset it like this, like I used to on the S7-200:
attachment.php


It won't let me clear the PV inside the DB associated with the counter, it says that it is read only. You can't use a bit logic reset. The only way I can see is to reset the variable DB22.DBW16, is it as simple as that?

Thanks

Bryan

S71200 Counter.jpg S7200 Counter reset.jpg
 
Don't have TIA here, but wasn't it something in the DB-definition ... one could declare the contents symbolic or not? Maybe I'm messing, but if you understand what I mean, could you try to unselect that option?
:)
Kalle
 
Hi Kalle

Thanks for that. Understand exactly what you meant so I created a new Counter, but when it creates an instance database for the Counter there isn't an option for Symbolic or not. I can't see anything in the properties for the timer or the database that I can 'adjust'. I think I will have to set up a PLC and create a test program to have a play.

Bryan
 
After some testing I can say that setting DB22.DBW16 to zero does not reset the counter. I can't find anyway to get access to the DB associated with the Counter, it is read only. The only way to reset the counter seems to be with the Reset (R) input and I can't use that because this FC isn't running when I want to reset the Counter. The only other option would be to have the Counter in two different FCs but that sounds like a very very bad idea.

Plan B is to write my own Counter subroutine so that I can have any access I want.

Maybe they will add the reset function in future updates.
 
i don'T know for counter as i never use them but for timing reset, their is a specail timer reset instruction....The coil unlatch reset doesn't work their...Their is a special one in the instruction tree...It may be you're problem..
I prefer to use .ADD. instruction instead of counter controling all the parameter by mylself
 
Hi Jeff

I spotted the Timer Reset instruction but there doesn't seem to be an equivalent one for the Counter. I even wondered if I could choose not to use the IEC version of the counter. I am sure that in MicroWin you could choose which method to use, but I can't spot anything in the new software.

Some of the stuff in the new software is impressive but there is a lot that I would say isn't yet ready to be used in real life.
 
i 100% agree with you, next week we are gonna get trainned for the new Version 11 of Portail that i expect to be renewed a little
 
After your training, and if it isn't too big an ask, can you tell us what are the main differences. Or ask Siemens if they have the differences listed on a web page.

Thanks

B
 
Hi Wolverine.

I Googled 'IEC Counters +Siemens' and that site came up, nowhere does it mention a separate Counter Reset instruction. No other IEC Counter website mentions a separate Counter Reset instruction. So I can only guess that IEC Counters don't have a separate Reset instruction.

What I wanted to do was to reset the counter to zero before the FC ran, but what I have ended up with is setting it to zero the first time it runs.

Outside of the Counter FC I set a 'Counter Reset' bit, Tag 8
attachment.php


then when the FC goes through its first cycle I use the 'Counter Reset' to reset the counter and then in the next network I reset the 'Counter Reset' bit. I shouldn't need the Tag 8 contact in Network 3, it is just there for this short test program.
attachment.php


Counter Reset Bit.jpg Counter FC.jpg
 
Well, IEC counter is just function block, so there really cant be any async reset. You can call it second time with same idb, but that is really bad programming. Better to either use just add's & moves if you need value to be reset to some value from reset point onwards, else use way you did in above post.
 

Similar Topics

Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
94
Hi Experts, I would like to make firmware upgrade from v3.0 to v4.5 (S7-1200 CPU 1215C). Can I do it from v3.0 to v4.5? Do I need to take some...
Replies
6
Views
179
Hi Guys, I am trying to establish communication over profinet between Siemens S7-1200 PLC as IO device and codesys plc as IO controller. But I am...
Replies
39
Views
2,053
Which signals do I have to use to get data from camera. For example camera detects a defect and sends signal to controller. Power cable: CCB-PWRIO-05
Replies
1
Views
160
Hi First post here! I admit I am not too used to handle interrupt OBs in Siemens. I have a customer who has been buying a standardized solution...
Replies
4
Views
210
Back
Top Bottom