6/29/2015 11:01 PM | |
Joined: 9/27/2006 Last visit: 8/13/2024 Posts: 12277 Rating:
|
Hello Ajay; You can extract the hours by your method, but it is harder than using directly the Date_and_Time variable provided by SFC1. The Date_and_Time (DT) format is a structure of bytes that each have a specific value in BCD. Byte 3 contains the Hours. You can access that byte, pass it through a BTI (byte to integer) instruction (in STL) and use it with an integer compare instruction to set your time triggers. See the following FAQ for more details, or open the online help for Date_and_Time: You could also open the following application note from Siemens Support; amongst other things you will find a Time of Day scheduling function that you can use in your program: Collection of Tools for Date and Time Functions Hope this helps, Daniel Chartier
|
Follow us on