(0)| 5/11/2019 7:52 AM | |
|
Posts: 30 Rating:
|
Dear Experts, I need to convert some data in bytes to DATE and TIME format. I am not getting any solutions ..pls help Thanks in advance... |
| 5/11/2019 2:43 PM | |
|
Joined: 9/27/2006 Last visit: 1/2/2026 Posts: 12479 Rating:
|
Hello Ajay; First, you need to complete your byte coding so you can add Microseconds and Day of the week fields so that you can convert them to a Date_and_time variable. How can you read out the date and time with SFC1 (READ_CLK) and set them with SFC0 (SET_CLK)? https://support.industry.siemens.com/cs/us/en/view/21222026 Once the format of your byte fields is corrected (look out for the Microseconds byte format, it occupies one full byte + the MDBs of the next byte, Day of the Week; one easy way to do so is t=o force the value of the Microseconds byte to b#w#0), all you need to do is create a Date_and_Time variable in one of your DBs and Move all those bytes to this variable. You will then be able to read the Date_and_Time data as a single construct. Hope this helps, Daniel Chartier |
This contribution was helpful to
|
|
| 5/11/2019 3:27 PM | |
|
Joined: 2/22/2008 Last visit: 4/25/2025 Posts: 2698 Rating:
|
Now i have found the structure also for date and time, but don't forget to convert your bytes first in BCD format. You will find the system manual here Regards, Scorp |
Last edited by: Jen_Moderator at: 05/13/2019 11:59:07Optimized link. |
|
Follow us on