Esa_Interface_Value_Set()
Abstract
Sets the value of an interface.
Syntax
Esa_Interface_Value_Set (esa_state_ptr, status_ptr, interface, schedule_time, …)
| Argument | Type | Description |
|---|---|---|
esa_state_ptr |
EsaT_State_Handle |
ESA state information generated by Esa_Init() |
status_ptr |
int * |
status value indicating cause of error (when return value is EsaC_Comp_Failure); one of the values in Table 2 External Simulation Access Package Symbolic Constants. |
interface |
EsaT_Interface |
identifier of the interface of interest |
schedule_time |
double |
simulation time at which an ESYS interrupt is to be delivered to the process model on the esys module where the interface resides. If set to ESAC_NOTIFY_IMMEDIATELY, this causes a forced interrupt of the process model in question.If set to ESAC_NOTIFY_NEVER, the interface value is set, but no notification is delivered to the simulation. |
... |
value to set to the interface (depends on the interface type) |
Return Type
EsaT_Compcode
EsaC_Comp_Success if the assignment succeeded; EsaC_Comp_Failure otherwise (in which case *status_ptr contains a value indicating the source of the failure).
Header
esa.h
Details
This function overwrites the interface value with the specified new value. An interrupt is delivered to the process model on the esys module containing the interface in question, unless schedule_time is the special value ESAC_NOTIFY_NEVER.
The interrupt will be a scheduled interrupt if a valid time is provided (assuming the time is greater or equal to the current simulation time) or a forced interrupt if schedule_time is set to ESAC_NOTIFY_IMMEDIATELY.
If the simulation time is currently between the time of the last executed event (T1) and the future time of the next scheduled event (T2), you should call Esa_Current_Event_Time_Set() with an appropriate value between T1 and T2 so that calls to op_sim_time() in the model code return a valid value (otherwise op_sim_time() will return T1).