|Re: Time to real conversion in FORTE 10 [message #1807508 is a reply to message #1807484]
||Fri, 31 May 2019 12:22
| Martin Melik-Merkumians
Registered: March 2016
First of all the TIME data type should be used for time duration. TIME can never hold a value of now
I support Alois here, the IEC 61131 says that TIME is only for duration, so NOW does not make any sense for this.
Therefore I think we should clean-up 4diac here and also remove the TIME() function and replace it with something like NOW. However I'm not sure if the return value should be DATE_AND_TIME or TIME_OF_DAY.
I like the name NOW, and it should return DATE_AND_TIME, as it is explicitly castable into DATE and TIME_OF_DAY, which would cover all data type holding times.
TIME_TO_REAL_S, TIME_TO_REAL_MS, TIME_TO_REAL_US, TIME_TO_REAL_NS
In principle I think such functions are needed but providing them with this kind of names would mean that there would be a lot of them as we would have to provide them for a variaty of type.
How about leaning even a little more to the CAST function of IEC 61131 and naming them TIME_IN_[S/MS/US/NS]_TO , so we could provide a *-cast version which types itself to the correct type?
Powered by FUDForum
. Page generated in 0.01939 seconds