Esa_Current_Event_Time_Set()
Abstract
Sets the simulation time to the specified value.
Syntax
Esa_Current_Event_Time_Set (esa_state_ptr, time)
| Argument | Type | Description |
|---|---|---|
esa_state_ptr |
EsaT_State_Handle |
ESA state information generated by Esa_Init() |
time |
double |
time value to use for the new simulation time. The value must be between the current time and the time of the next scheduled event. |
Return Type
EsaT_Compcode
EsaC_Comp_Success if a time value could be set; EsaC_Comp_Failure otherwise.
Header
esa.h
Details
This function provides a mechanism to advance the simulation’s view of time. Simulation time normally advances based on the scheduled events. Thus, after events at a given time T1 are all executed, the time jumps ahead to time T2 (when the next event is scheduled). In the context of a cosimulation, however, it is possible for other things to occur between times T1 and T2.
At times, it might be necessary to invoke some application code in the gap between times T1 and T2 (for example, as a result of setting an interface value with an execution option of ESAC_NOTIFY_IMMEDIATELY). At such times, use this function to set the current simulation time to an appropriate value between T1 and T2 such that a call to op_sim_time() will return a meaningful value.