Running Hours in S7

leem2209

Lifetime Supporting Member
Join Date
May 2015
Location
Wirral, UK
Posts
210
Hey All,

I'm looking at putting a running hours indicator into a system and wondered what the best way to do it is.

This is what I've come up with but wondered if there is an easier way or a special function somewhere to record the hours?

ketffr.png


I would then transfer the MW27 to the HMI to display running hours of the system.

Thanks in advance....

Mark
 
Last edited:
I would never use an address that is edge triggered twice.

Really you don't need any as long as your pulse is a pulse. If not I would leave that first one.

The next ones you don't need. I would also combine the networks that would count minutes and reset the seconds in one. (same for minutes/hours).

Similar application attached.

1.jpg 2.PNG
 
Looks OK to me. I use something similar too I haven't found any special function for that. Hopefully there is one.

You need those edge trigger because the pulse is not a real pulse in Siemens

You can simplify is as boneless said.
 
Looks OK to me. I use something similar too I haven't found any special function for that. Hopefully there is one.

You need those edge trigger because the pulse is not a real pulse in Siemens

You can simplify is as boneless said.

Actually I've only used S7-300 series and the memory clock is not a real pulse on them.

It all depends what M152.6 (1sec Pulse) is.
 
Actually I've only used S7-300 series and the memory clock is not a real pulse on them.

It all depends what M152.6 (1sec Pulse) is.

M152.6 is just a random unused mem bit. In the real program, it will be M1.5 which is set up in the clock/cycle memory function in the cpu properties.

Just running the program now to test and seems to be working fine. I've not incorporated the seconds/minutes resets into the same networks as Boneless suggested, but will do that tomorrow. For now, its bedtime!

Just one problem I had, if I edited the MW23, MW25 and MW27 in the symbol table, they showed up as "Type Conflict with entry in symbol table" on the networks, but if I deleted them from the symbol table again and never gave them a symbol name or comment, they work ok... what caused this issue?
 
M152.6 is just a random unused mem bit. In the real program, it will be M1.5 which is set up in the clock/cycle memory function in the cpu properties.

Just running the program now to test and seems to be working fine. I've not incorporated the seconds/minutes resets into the same networks as Boneless suggested, but will do that tomorrow. For now, its bedtime!

Just one problem I had, if I edited the MW23, MW25 and MW27 in the symbol table, they showed up as "Type Conflict with entry in symbol table" on the networks, but if I deleted them from the symbol table again and never gave them a symbol name or comment, they work ok... what caused this issue?

As I said If you use clock memory then you'll definitely need edge detection since clock memory is not a real pulse.

What is Symbol Table?
 
The symbol table that holds all the Comment data and symbolic name data for your addresses...

I tried giving MW23 a symbolic address of "RT_sec" and a comment of "runtime seconds"
MW25 "RT_min" and "runtime minutes"
MW27 "RT_hour" and "runtime hours"

Doing this led to the address showing in red in each network indicating that "Type conflict with entry in symbol table"
 
Take a look at SFC2 / 3 / 4 which are standard Siemens blocks that provide a run time meter. Why reinvent the wheel?
 
Take a look at SFC2 / 3 / 4 which are standard Siemens blocks that provide a run time meter. Why reinvent the wheel?

Thanks - this is what I wondered. I thought there may be a function already available somewhere.

Now... how do you use the inbuilt runtime meters?

I've found limited info in tinternet....

A runtime meter counts the operating hours of connected equipment or the total runtime hours of
the CPU.
In STOP mode, the runtime meter is stopped. Its count value is retained even after a memory
reset. During a restart (warm restart), the runtime meter must be restarted by the user program;
during a hot restart, it continues automatically if it had already been started.
You can set the runtime meter to an initial value using SFC2 SET_RTM. You can start or stop the
runtime meter with SFC3 CTRL_RTM. You can read the current total operating hours and the state
of the counter ("stopped" or "counting") with SFC4 READ_RTM.
A CPU can have up to eight run-time meters. Numbering starts at 0.
 
Thanks - this is what I wondered. I thought there may be a function already available somewhere.

Now... how do you use the inbuilt runtime meters?

I've found limited info in tinternet....

A runtime meter counts the operating hours of connected equipment or the total runtime hours of
the CPU.
In STOP mode, the runtime meter is stopped. Its count value is retained even after a memory
reset. During a restart (warm restart), the runtime meter must be restarted by the user program;
during a hot restart, it continues automatically if it had already been started.
You can set the runtime meter to an initial value using SFC2 SET_RTM. You can start or stop the
runtime meter with SFC3 CTRL_RTM. You can read the current total operating hours and the state
of the counter ("stopped" or "counting") with SFC4 READ_RTM.
A CPU can have up to eight run-time meters. Numbering starts at 0.

The best way to find out how to use them is to highlight the block, hit F1 and bring up the help. It should tell you what each parameter means, and how to use them.
 
Eh.. Use simatic managers help?

SFC3 starts/stops runtime meter and you can read it with using SFC4. Notice, it has hours as units and overflows and stops at 32767 hours. So that special case you need to take into account. Its not long ago when i had to modifu some equipmets code becouse that overflow had not been taken into account.
 
The best way to find out how to use them is to highlight the block, hit F1 and bring up the help. It should tell you what each parameter means, and how to use them.

How do I get or where do I find these SFC's? Under the SFC folder in the library, it is empty so cannot work out how to insert?

>>>>SCRAP THIS QUESTION, FOUND IT<<<<
 
Last edited:
OK, so for anyone else who may happen to want a similar function, here's where SFC3 is...

In your S7 editor, with the left hand OVERVIEW column displayed, look here:
Libraries -> Standard Library -> System Function Blocks -> SFC3

Insert it into your network and fill in the trigger and address details as required.

I've just set it up and running it to test.
 
Left running for an hour now and my CV output of SFC4 (MW32 in my case) has turned to 1.

I've learnt something valuable so thank you all for helping! :)
 

Similar Topics

Hi, I'm experienced in Studio 5000 / ControlLogix but have a small project to do in a Micro810 with CCW and something is driving me nuts. I want...
Replies
14
Views
4,037
Dear engineers, i want to change the hours meter to any value i need but i can't change it. how to change it...plz help me
Replies
7
Views
2,028
I want to find pump running Hours(H,M,S). How I can find it?
Replies
6
Views
2,396
Dear All, I need your help to program a PL7 to count running hours of motors. Can anybody send me the program. Regards, Marwan
Replies
0
Views
1,891
I have no experience with Eaton HMIs. I downloaded the Galileo software and I am trying to get the file on a HMI (XV-102-H3-70twrl-10) to modify a...
Replies
5
Views
128
Back
Top Bottom