JUO SAVE A JOS ON
Member
Hi folks. This is my first forum post, I've been practicing S7/STL/WinCC Flex stuff for about 3 months now so hopefully we speak same language, even thou I constantly mix most and least significant bit and such, due history with computers
I have time/date values stored in DATE_AND_TIME in S7-300 and I'm working with kind of temporary, debugging- or low-level user interface with WinCC Flex for it.
I just noticed that if I modify the date-part of D_AND_T with Var-monitor but do not change day-of-week nibble accordingly, WinCC Flex Runtime will render that date and/or time in IO Field to line of # chars, obviously indicating that the DATE_AND_TIME value is broken. Even thou it doesn't show the value even if it was correct.
Now, this isn't a big issue yet if I can screw things by forcing values to DB, but I'm sure that I will run into difficulties with dates and times later, perhaps in another project where I'm trying to let's say read date values without week-day, finding that something like Call SB_DT_DT would return rubbish as the input was "rubbish" aswell.
So, is there a "common practice" way to validate or re-generate day-of-week of DATE_AND_TIME in PLC side? Where will broken day-of-week cause problems? Do you people avoid calendar-dates whenever possible? What if your customer wants daylight-saving or their ERP-system uses it and you need to communicate with it?
As the presentation of future, current and past time is formed depend on rulings of kings, emperors or EU bureaucrats, it would be very frustrating to write one's own date-manipulation functions, those would inevitably be broken if not yet but in future before, just as daylight saving breaks public transport and sleeping rhythms besides your computer(you wouldn't need to download an update every year if it wasn't broken right). If I met an extraterrestial, I'd be very ashamed of how we earth-people represent time
I have time/date values stored in DATE_AND_TIME in S7-300 and I'm working with kind of temporary, debugging- or low-level user interface with WinCC Flex for it.
I just noticed that if I modify the date-part of D_AND_T with Var-monitor but do not change day-of-week nibble accordingly, WinCC Flex Runtime will render that date and/or time in IO Field to line of # chars, obviously indicating that the DATE_AND_TIME value is broken. Even thou it doesn't show the value even if it was correct.
Now, this isn't a big issue yet if I can screw things by forcing values to DB, but I'm sure that I will run into difficulties with dates and times later, perhaps in another project where I'm trying to let's say read date values without week-day, finding that something like Call SB_DT_DT would return rubbish as the input was "rubbish" aswell.
So, is there a "common practice" way to validate or re-generate day-of-week of DATE_AND_TIME in PLC side? Where will broken day-of-week cause problems? Do you people avoid calendar-dates whenever possible? What if your customer wants daylight-saving or their ERP-system uses it and you need to communicate with it?
As the presentation of future, current and past time is formed depend on rulings of kings, emperors or EU bureaucrats, it would be very frustrating to write one's own date-manipulation functions, those would inevitably be broken if not yet but in future before, just as daylight saving breaks public transport and sleeping rhythms besides your computer(you wouldn't need to download an update every year if it wasn't broken right). If I met an extraterrestial, I'd be very ashamed of how we earth-people represent time