Siemens S7 Counters

qee

Member
Join Date
Dec 2003
Posts
23
Hello All,

I'm struggling with programming and using Step 7 counter instructions.
Basically I want a simple counter that increases by 1 at a certain event up to a maximum of 11 before resetting.

Whilst the counter is performing it's duty I wish to compare the current value of the counter and set different memory bits depending on the counter value.

The counter for arguments sake is C1 called MASTER_COUNTER.

What I'm having trouble with is comparing the counter value.
When using a compare instruction, what address should I enter that represents the current counter value? ( i.e. Where is C1 counter value stored and how is this addressed?)

I'm mainly a Allen Bradley guy that's use to pointing everything to T4:1.ACC etc. Therefore are S7 counters and also timers similar to how Bradley use them?

Can someone please help?

Thanks.
Qee.
 
If you are programming in ladder you can go to the program elements catalog, go under counters and select one of the block format instructions. On the right side you will see 'CV', which is the count value in hex, and 'CV_BCD' which is the count value in BCD. Simply tie a memory word or DB word to these locations and you will have the current count.
In STL it's even easier. If you enter:
L C1
T MW100
the plc will get the current value of the counter (in this case C1) and move it to MW100. You can use C1 directly in other ways, such as
A(
L C1
L Mw50
>I
)
= M1.0

I hope this helps.
Keith
 
Hi guys,

I am still learning s7-300 instruction set. I am having problems with the -(SC)- "set counter" and -(CU)- "Up Counter Coil" instructions. When using the Down Counter Coil (CD) the counter decrements well and even resets. But when i use the up counter coil (CU) the set counter coil and the (CU) both jump to the preset value and starts incrementing from there. please help.

here is my program code
 
Please specify what you are doing with inputs I24.0 I24.1 and I24.2 to get the behaviour you are reporting.
 
Hi guys,

I am still learning s7-300 instruction set. I am having problems with the -(SC)- "set counter" and -(CU)- "Up Counter Coil" instructions. When using the Down Counter Coil (CD) the counter decrements well and even resets. But when i use the up counter coil (CU) the set counter coil and the (CU) both jump to the preset value and starts incrementing from there. please help.

here is my program code

This is the normal behavior of up-counter in Siemens for details see attached example it loads preset value and start incrementing from there up to 999.


I hope this will help!
 
Last edited:

Similar Topics

Hello friends I am new in this field I try to set and up counter in S7 300 station.Its count but counter not stop on the preset veluve.Can any one...
Replies
3
Views
10,169
I'm new to PLC'S and I was given the task to program a valve with a HL and LL. If HIGH LIMIT isn't reached within 15s you must have a FAIL_TO_OPEN...
Replies
1
Views
5,781
M
Please help me !!! I am currently using a Siemens PLC the CPU is a 312C and i have a 100 pulse encoder wired into the 2 high speed inputs. I wish...
Replies
1
Views
7,429
OK. You guys helped me out a bunch with my first Siemens question. I found a bunch of issues with integrity checking the PLC programs I was...
Replies
3
Views
112
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
95
Back
Top Bottom