Industry Online Support
Technical Forum
1/20/2010 6:16 PM | |
Posts: 51 Rating: (3) |
have a look at thisthread if you implement the code detailed there then you can pull values for hours, minutes, seconds, day of week etc out and use those for doing what you want to do. is there a front-end on the system? quite often there are features in front-end packages to create schedules which could, for instance, toggle a bit via OPC, which would be a better way of doing it in the long run. otherwise if the schedule needs to be changed you have to go back and modify the code. i'm not sure what will happen to the CPU's real-time clock during a power failure. someone else might be able to shed some light as to whether it has some short-term backup battery or something. does the particular CPU 315 you are using have an ethernet port for profinet communications? if so, you can usually go into the hardware config and set it to update the real time clock periodically from NTP servers, but it will obviously need to sit on a network with a route out to the internet. check outthis pagefor details on IP addresses of time servers. this would make sure that following a power failure it would reset the clock to the correct time. another thing to bear in mind is daylight saving time. the s7-400 CPUs can be made aware of it through the hardware config, but on the 315 it's not quite that simple, but it can be done. take a look at thisthread. hope this helps |
Follow us on