call: String ExpectedEndTime(float StartValue, float EndValue, float CurrentValue, int& Percentage)

input: StartValue, EndValue, CurrentValue, reference to Percentage
output: String

For the prediction of an estimated time of completion, there are 2 functions available in the AFSM e.g.; TriggerExpectedEndTime and ExpectedEndTime. The function TriggerExpectedEndTime must be called once in the state before the next state containing a process where the end of completion has to be predicted. In the FSM state where the end of completion has to be predicted, this funcion has to be called in de loop where the start and the end value is monitored. After 5% of completion the prediction is made based on the startvalue, end value, the current process value and the elapsed time between the first call of this function and the present time.
Remarks: the prediction is based on a lineair process sequence. The process sequences may have a positive or negative curve. Prediction is only active when HMI is present. The function returns a string presentation of hour:minute in 24h format. Days and seconds omitted. Like in the example, the calculation is made every 250mS. It is not recommented to perform the calculation every AFSM cylce. See also TriggerExpectedEndTime.

Below an example of the simulation programm: