cgsl_0405: Data receive for component deployment
ID: Title | cgsl_0405: Data receive for component deployment | |||
---|---|---|---|---|
Description | A | To model a call to the target platform receiver service, use an In Bus Element or Inport block. | ||
B | To safeguard data for concurrent access, map the component inports to a service interface that is configured to use the During Execution or Outside Execution communication method.
| |||
C | When concurrent access to data is not a concern, map component inports to a service interface that is configured to use the Direct Access communication method. In this case, no safeguard for data access is provided. | |||
Rationale | The generated code aligns with the data communication method that is required by the target platform environment. | |||
Model Advisor Check | A Model Advisor check is not necessary for this guideline because a service interface for a receiver service must be configured to use one of the three data communication methods. | |||
Example | Specifying the Data Communication Method for Calling the Target Platform Data Receiver Service In this example, the data communication method is set to Outside Execution. void CD_integrator(void) { . . . for (i = 0; i < 10; i++) { . . . rtDWork.DiscreteTimeIntegrator_PREV_U[i] = (get_CD_integrator_input())[i]; } . . . } In this example, the data communication method is set to During Execution. void CD_integrator(void) { . . . real_T tmp[10]; . . . get_CD_integrator_input(&tmp[0]); . . . for (i = 0; i < 10; i++) { . . . rtDWork.DiscreteTimeIntegrator_PREV_U[i] = tmp[i] } . . . } In this example, the data communication method is set to Direct Access. void CD_integrator(void) { . . . for (i = 0; i < 10; i++) { . . . ... = CD_sig.In[i]; } . . . } |
See Also
Code Interfaces and Code Interface Specification (Embedded Coder)
Receiver and Sender Service Interfaces (Embedded Coder)
Data Communication Methods (Embedded Coder)
Embedded Coder Dictionary (Embedded Coder)
Select Code Generation Output for Target Platform Deployment (Embedded Coder)
In Bus Element block
Inport block
get
(Embedded Coder) function