Larger(999+) in LAD in S7

Coralreef

Member
Join Date
May 2006
Location
Dk
Posts
23
Hi

Just wondering....

What is the MOST simple LADDER solution for creating a counter in S7 that goes larger than the standard 999 as a max count value ?
 
Actually, this an excellent beginners task to learn programming S7.

I'll give you a few tips:

Depending on how large the count value can be, use an INT or a DINT variable for the count value.

Use a oneshot to trigger the incrementing/decrementing of the counter.

Everything can be done in LAD.

Post your code and we will praise your efforts accordingly.
 
Hehe i meant the ladder function, but i will check that later... Until then here is a image of how i would connect severel counters to gain higher values than 999 !
 
Well, I definitely wouldn't do it like that.
I dont use the S5 counters at all.

Creating your own counter with an INT or DINT is not more complicated than what you have made with cascading 2 S5 counters.
 
Yes you could just do it with a few math functions...

But my question was regarding the S7 standard counters and their max of 999 ;)
 
Your posted ladder will not work - you have M bits clashing for the count value and the count bits, as well as using MW1 with MW2 which will also overlap.

If you resolve these minor issues the code will work but note that this code will increment the second counter when the first count transitions from 998 to 999 so the second counter will be a count of 999's not 1000's. As long as you know this, you can combine the two counts to give a count greater than 999
 
Coralreef said:
Yes you could just do it with a few math functions...

But my question was regarding the S7 standard counters and their max of 999 ;)

There're counters implemented as SFBs available in S7. They are reffered as IEC counters. And of course no 999 max.
 
Perfect STL???.

Why are we using standard counters if there is a simpler way, like that? I understand timers not easy to implement because it uses interrupts, but what is the special with counters?
 
If you don't want a count reset, an in-built edge store, a bcd output or the counter to stop counting when it reaches 999 then use another implementation.
 
I am not strong on Step7 therfore I am somewhat confused on the question.

I know it has SFB0 count up which goes from 0-32767 plus other functions (Siemens call them functions but others would say instructions, at least that is how I think about it).

It has SFB1 count down, SFB2 CTUD, and the one I have used the most is SFB38 high speed counter. All of these can be used in ladder.

DID I miss something?
 

Similar Topics

I'm a beginner in the automation field and I've set up an automation system connecting several devices (datalogger, radio, etc.) via Modbus RS485...
Replies
5
Views
220
I have been tasked to supply a location with a backup power supply that can run 240V at 20 amp nominal with 70 amp peak pump loads (120 Seconds...
Replies
13
Views
3,788
Hi guys, Been handed a new SNAFU on a job. The MCC what provided with a SMC Flex Soft Starter for a 40hp motor but the motor that was installed...
Replies
11
Views
2,417
I am trying to send data from my Guardlogix 1756-L72S to a Leibinger JET3 UP PI Printer trough a MSG instruction, I can send information if the...
Replies
10
Views
4,209
Hi Everyone, It's been a while. I have an opportunity to install a system that uses a 480V 3phase 4.4kW gearmotor driven by a 11kW VFD. Everything...
Replies
17
Views
8,691
Back
Top Bottom