Bug: LINT_TO_TIME, ULINT_TO_TIME, Signed Data Down Counters [message #1754959] |
Fri, 24 February 2017 14:38 |
yuvaraj velumani Messages: 15 Registered: April 2016 |
Junior Member |
|
|
Hi,
I was trying to test some of the function blocks and noticed few of them are really not working as per their functional requirement states.
For example:
1) F_SINT_TO_TIME, F_INT_TO_TIME, F_DINT_TO_TIME, F_LINT_TO_TIME:
As these are used to convert a signed data variable to TIME data type, what is the real use case in converting negative value to TIME?
2) F_ULINT_TO_TIME:
Since it is converting 8 byte to TIME and the maximum OUT value which I receive is T#922372036000ms. But the maximum 8 byte data range is actually from 0 to 18,446,744,073,709,551,615 and shouldn't be the OUT range from T#0ms to T#18446744073709551615ms.
3) signed data down counters:
The Q output turns TRUE when CV become less than or equal to zero. So for all negative ranges the output remains TRUE. What is the purpose of having signed down counters? Shouldn't it be counting till its minimum value and then make Q output TRUE?
|
|
|
Re: Bug: LINT_TO_TIME, ULINT_TO_TIME, Signed Data Down Counters [message #1754961 is a reply to message #1754959] |
Fri, 24 February 2017 15:48 |
|
Hi,
this is the defined behaviour according to IEC 61131-3. TIME is there defined as time duration. As something can happen before something else also negative time durations are possible. As we are currently storing the time duration values in 64Bit only a little bit more then +-9*10^18 are the max and min values. As we are storing internally typically µs or ns depending on the configuration of your FORTE this value goes even further down.
I hope this helps.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03499 seconds