how to get the current date and time from s7 300 cpu?

Use SFC1 (FC_read_clk) to obtain Date and Time and "send" to a "date/time parameter.

The date & time parameter is 8 bytes long and has the following format:-

0 Year 1990 to 2089
1 Month 01 to 12
2 Day 1 to 31
3 Hour 0 to 23
4 Minute 0 to 59
5 Second 0 to 59
6 2 MSD of ms 00 to 99
7 (4 MSB) LSD of ms 0 to 9
7 (4 LSB) Day of week 1 to 7 (1 = Sunday)

use these bytes within your program.



Best of luck
 

Similar Topics

I'm struggling with this...Times and Dates are always a mental-block for me. See picture. When I press SAVE, I want to take the current...
Replies
14
Views
1,540
Hello- I am using a TECO SG2-series PLC and am wondering if there is a simple way to write the current date and time to the panel display. I am...
Replies
0
Views
1,092
Hello, I have a question that is not specific to any particular PLC brand even if it might work differently for some. I hava a 4-20 mA sensor...
Replies
3
Views
3,710
I'm using a Simatic 400 (CPU 414-2 DP) in S7. Now i want to use the current date with the READ_CLK SFC1 function and transfer this into a string...
Replies
8
Views
7,080
Today I was working on my project for school and we were using a power supply with 24V and we accidentally had the current at 0.9A. We heard a pop...
Replies
9
Views
497
Back
Top Bottom