Main Content

cgsl_0406: Data send for component deployment

ID: Titlecgsl_0406: Data send for component deployment
DescriptionA

To model a call to the target platform sender service, use an Out Bus Element or Outport block.

B

To safeguard data for concurrent access, map the component outports to a service interface that is configured to use the During Execution or Outside execution communication method.

  • During Execution —The generated callable function that implements the algorithm safeguards data access for concurrency.

  • Outside Execution — The target platform service safeguards data access for concurrency.

C

When concurrent access to data is not a concern, map component outports to a service interface that is configured to use the Direct Access communication method. In this case, no safeguard for data access is provided.

RationaleThe generated code aligns with the data communication method that is required by the target platform environment.
Model Advisor CheckA Model Advisor check is not necessary for this guideline because a service interface for a sender 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 Sender Service

Embedded Coder dictionary interface for selecting the data communication method

In this example, the data communication method is set to Outside Execution.

void CD_accumulator(void)
{
  .
  .
  .
  for (i = 0; i < 10; i++) {
    .
    (set_CD_accumulator_out())[i] = CD_param.tunable_gain * CD_sig.delay[i];
  }
}

In this example, the data communication method is set to During Execution.

void CD_accumulator(void)
{
  real_T out[10];
  .
  .
  .
  for (i = 0; i < 10; i++) {
    .
    out[i] = CD_param.tunable_gain * CD_sig.delay[i];
  }
  set_CD_accumulator_out(&out[0]);
}

In this example, the data communication method is set to Direct Access.

void CD_accumulator(void)
{
  .
  .  
  .
  for (i = 0; i < 10; i++) {
    .
    .
    .
    CD_sig.out[i] = CD_param.tunable_gain * CD_sig.delay[i];
  }
}

Version History

expand all

Introduced in R2022b