S7 Time of day event

askgaard

Member
Join Date
Apr 2003
Location
Denmark
Posts
5
I need to add to my program a pump, that automatically starts at 6.00 am and stops at 22.00 pm.
How can I use the integrated clock in a S7-300?
I will also add the possibility, so that the time can changed by typing it on a OP-Panel.

Can I make this timeevent, or do I have to use a extern clock?

Thomas
 
Thomas,

check the helpfiles for OB10 to OB17 - time-of-day interrupt. Also check the systemfunctions SFC28 to SFC30, with which you can set, cancel or activate the interrupt from within the program.

Kind regards,

Jean Pierre Vandecandelaere
 
Hello!
To read the the time use "Read_CLK" SFC 1.
(output is struct of bytes, use BTI to get the parts if you do not use the IEC fc 8)

Use IEC blocks FC 8 "DT_TOD" to get the exact time

first:

CALL SFC 1
( RET_VAL :=#cur_RETVAL,
CDT :=#OUT_TIME_DATE);

CALL FC8
( IN :=#OUT_TIME_DATE
RET_VAL:=#OUT_TIME);l

L #OUT_TIME
T MD 10;

then you just have to compare the values and trigger your funtions, read the help files in Step 7 "program blocks"
 
Niclas,

the method you explain will work, but is less efficient than the method using time-of-day interrupts.

Thomas,

sorry, but the explanation I could give you would be the same as you can find in the help files from Step7 short of giving you the solution. I'm earning a living teaching and I won't throw away my earnings, so you have to show you have done something yourself before I should help you any further. Please put some effort in!

Kind regards,

Jean Pierre Vandecandelaere
 
I'll give you a head start. If you are using a TP170b and you want to read and set your clock in the PLC, your in luck. Hopefully, you have Protool to configure the TP. The attached program stores the current time in a DB and allows a NEW time to be set with a bit from a button. All you have to do is to write the compare block for your on / off time. I would strongly suggest using the TP170b and putting the ON /OFF time on a screen. If you can't figure it out, drop me an email, I have already written the compare blocks, but you can do it!
 
Date and time of S7 plc

Get simply the time and date of the plc by using SFC1, FC6 anf FC8

Once you get this data in a DB, you can compare it and do anything with is. You can even select the days, months, years... you want to work with.

Best use it by programming in SCL.

Bye

Walter
 

Similar Topics

From the Red Lion website, after some customer enquiries in the last week or so... Rev. March 25, 2024 [18:30] Just thought it might help a...
Replies
9
Views
247
This may be something obvious that I could learn if I sat down to understand the topic in detail with tutorials and manuals. But sometimes it's...
Replies
0
Views
124
Hello, we have two PC with the FT SE local application and the same project. The one PC is wrong about alarm and event log. When I open the...
Replies
2
Views
426
Kindly, we are having a problem on a machine during night shifts, while no engineering tool is online. So, we were thinking of programming some...
Replies
9
Views
750
I have a issue with my alarm summary/banner where it losses connection to the Alarm Server. It's kind of weird because when I click on the server...
Replies
2
Views
1,317
Back
Top Bottom