1/29/2016 1:40 PM | |
Joined: 9/23/2005 Last visit: 11/18/2024 Posts: 4795 Rating: (733) |
http://www.ucolick.org/~sla/leapsecs/epochtime.html Good luck |
Regards, |
|
1/30/2016 6:01 AM | |
Posts: 56 Rating: (2) |
Thank you :) AttachmentConvertToUtime.zip (186 Downloads) |
2/1/2016 9:43 AM | |
Joined: 9/23/2005 Last visit: 11/18/2024 Posts: 4795 Rating: (733) |
Well, your screen shots and the source file don't match. What's up? BTW, in the source file all type cast functions are missing underscores in their names. I.e. "INT TO DINT" should be "INT_TO_DINT" and so on. BTW2, have look here and here. BTW3, despite we are talking in Step7 conference, from the screen shots it can be seen that you use TIA. Moreover you write software for the 1500 possibly. Why don't you use simplest way DTL_TO_LDT ? Unless you write it for the 1200... |
Last edited by: jacek d at: 2/1/2016 10:09:06 AMBTW3 added Regards, |
|
2/2/2016 11:02 AM | |
Joined: 6/24/2013 Last visit: 11/18/2024 Posts: 1652 Rating: (426)
|
Function which uses tricks from Jaceks' links (thanks!) attached. The pre-condition for long formula where it uses year-1900 is embedded in formula itself Comprehensive arguments check is applied too Function returns: 1. ENO=FALSE and RET_VAL=0 when any argument is not good 2. ENO=TRUE and RET_VAL=seconds since 1970/01/01, 00:00hrs (as double int) when all arguments are good. NOTE: YEAR is limited to 2038 to prevent arithmetic overflow. When higher years are required 64-bit Int data type is required (you will need create your own library or use 64-bit REAL - library can be found here: https://support.industry.siemens.com/tf/gb/en/posts/64-bit-real-support-for-s7-300-plcs/121779/?page=0&pageSize=10&zone=Extranet) . AttachmentFC3_Seconds_Since_1970_01_01_0000hrs.pdf (361 Downloads) |
This contribution was helpful to2 thankful Users |
2/4/2016 12:07 PM | |
Posts: 1 Rating: (0) |
Thank you all for feedback! |
3/14/2016 11:22 PM | |
Joined: 6/24/2013 Last visit: 11/18/2024 Posts: 1652 Rating: (426)
|
Hi I did this for SCADA because it is unable to eat BCDs: attached - function which does make combined date / time and updates system clock. ADDED AS AN EXAMPLE in the last network: example how to split date and time to individual elements (yyyy / mm / dd / hours / mins / seconds) Attachment!FC98.pdf (210 Downloads) |
This contribution was helpful to1 thankful Users |
Follow us on