Elapsed time calculation in s7 400

Ultimate99

Member
Join Date
Nov 2009
Location
UK
Posts
6
Hi !
I need a help to write a code and display remaining time on HMI.
Initial time in (0 to 24 hrs) is entered from HMI
Valve Open time (0-50 sec ) entered from HMI
Wait delay time (0-24 hrs ) entered from HMI

The application is , if operator enters initial time as 8am
valve open time as 20sec and wait time as 2hrs
then valve should open at 8am , keep open for 20 sec and then close, after a wait time of 2hrs i.e. at 10 am valve should open again. I want to display the remaining time to open the valve on HMI , the main problem is if operator changes initial time then it should immediately reflect on remaining time display. for example valve has opened at 8am and wait time is 2hrs then next due is at 10am , if current time is 9am then display will be 1hr remained , if operator changes initial time to 9.30am then remaining time to open the valve should show 30mins.

Please help me to write the code in siemens s7.
the plc is s7 400 and hmi is winncc flex mp277

Thanks..
 
I suggest you look into the functions for Time of Day; A 412-2DP has two TOD interrupts (OB10 & OB11). You can programatically setup an interrupt to execute on a specific date at a specific time. You could probably also write a script in the HMI that would do the job.

Using some SFCs you can build a very flexible system. SFC0 Set Clock, SFC1 Read Clock, SFC28 Set TINT, SFC29 Cancel TINT, SFC 30 Activate TINT, SFC31 Query TINT.

Nick
 
You have to program both wincc flex and S7-400

Use infield facility to input any value from WinCC side and learn about timing programs from S7-400 manual Time of Day and other timers and connect the necessary values of the PLC program (memory, preset value of the time etc) with your infield of WinCC.

Go through manuals and if you have any problems, please ask. We will help you to code, but you have to do the coding.
 

Similar Topics

So I'm assuming this is a rounding issue somewhere, but I don't know for sure so I figured someone else would. Made an AOI that just gives me a...
Replies
12
Views
3,957
Hi group, I am trying to figure out how to calculate time elapsed during a power failure. If the PLC is off for more than 30 minutes, when the...
Replies
9
Views
2,212
I have some code that is going to trigger calculations to happen either when "A" happens, or every 1 second. For the 1second trigger, I am...
Replies
3
Views
1,624
For better or worse the project I am working on has specified several equipment elapsed time meters that are supposed to have their values...
Replies
7
Views
2,103
I have not been able to get the elapsed time from a timer in a Siemens Simatic S7-1200 to display correctly on a Red Lion G315 HMI. I have...
Replies
18
Views
8,572
Back
Top Bottom