T74-2016: BIOVIA LES Duration Calculations and Limits
LES
When performing mathematical operations on values, specifically duration calculations, an incorrect precision result can be produced. This problem is due to the precision of the calculated duration results stored within the database.
For example:
Results stored in DB | Results displayed on LES |
OOL Flags are not displayed properly after data collection. The values will display correctly after a refresh (navigating out of the step and back onto it) or in Data Review.
Resolution:
A workaround should be used involving the Format and Formula reading of the Excel Adapter for LES, thus performing the duration calculation utilizing the calculation capabilities of MS Excel, truncating the end result and then formatting the final output.
Example of a duration calculation in minutes:
|* Duration Calculation [mins] = XEIN: Excel Adapter Format and Formula: Excel: FORMAT AND FORMULA. Format: 0.00, Formula = TRUNC((("%End Time%"-"%Start Time%")*1440|5) *|
Results are not displayed in the elapsed time format, but using a decimal representation instead.
If limits are required, then the appropriate decimal representation should be applied:
Example: Limits within 1.5 to 2.5 minutes
|* Duration Calculation [mins] = XEIN: Excel Adapter Format and Formula: Excel: FORMAT AND FORMULA. Format: 0.00, Formula = TRUNC((("%End Time%"-"%Start Time%")*1440|5) *|
|* LIMIT: Duration Calculation [mins] >=1.5 and <=2.5: "Out of Limit!" *|
The reason that this method works is because Excel times are internally stored as decimal values, with the value 1.0 used to represent 24 hours, and therefore:
- the value 1/24 used to represent 1 hour;
- the value 1/1440 used to represent 1 minute;
- the value 1/86400 used to represent 1 second.
Error Mesage:
N/A