Hello guys,
I need your help about using date and time types in Step 7.
I need to make a simple PLC program that needs to take current date and time
and extract time of week (1 = Sunday...), Current date and current time.
If current time is between 7:00 nad 15:00 (3 pm) program sets some output to 1, otherwise
it remains 0. If day of the week is Monday (2) program sets other binary output
to 1 and similar.
I've read documentation and found out that DATE_AND_TIME format is what I need, so
I decided to use it with IEC functions DT_DAY (to extract current day of week),
DT_DATE ( to extract current date) and DT_TOD (to extract current time). However
I don't know how to find out all these things. )Is there any way to access PLC's date and time if exists just like date and time in BIOS in PC). Is there any library function that reads current DATE and TIME,
and store it into some variable example VAR1. My idea is to create my own function in which all these IEC
functions would be caled.
How to solve this if it's possible at all?
Thanks very much
I need your help about using date and time types in Step 7.
I need to make a simple PLC program that needs to take current date and time
and extract time of week (1 = Sunday...), Current date and current time.
If current time is between 7:00 nad 15:00 (3 pm) program sets some output to 1, otherwise
it remains 0. If day of the week is Monday (2) program sets other binary output
to 1 and similar.
I've read documentation and found out that DATE_AND_TIME format is what I need, so
I decided to use it with IEC functions DT_DAY (to extract current day of week),
DT_DATE ( to extract current date) and DT_TOD (to extract current time). However
I don't know how to find out all these things. )Is there any way to access PLC's date and time if exists just like date and time in BIOS in PC). Is there any library function that reads current DATE and TIME,
and store it into some variable example VAR1. My idea is to create my own function in which all these IEC
functions would be caled.
How to solve this if it's possible at all?
Thanks very much
Last edited: