Time to real conversion in FORTE 10 [message #1807439] |
Thu, 30 May 2019 03:43  |
Eclipse User |
|
|
|
I want to do mathematical operations in the form of integrals and derivations, so I need to block the conversion of data time types to real. How do you convert this data type to FORTE 10?
|
|
|
|
|
|
|
|
Re: Time to real conversion in FORTE 10 [message #1807508 is a reply to message #1807484] |
Fri, 31 May 2019 08:22   |
Eclipse User |
|
|
|
Hi all,
Quote: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.
Quote: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.
Quote: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?
Best,
Martin
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.28459 seconds