Main Content

Data Transfer Interfaces

Within a platform environment, callable functions that are within a component exchange data by calling the platform data transfer service. To represent calls to a platform data transfer service in a component model and configure the relevant data elements for code generation:

  1. In the component model, represent a data transfer by using a signal line that connects the communicating functions.

  2. For function platform deployment, if the platform service that handles the data transfers uses during-execution data access, create a memory buffer to hold the value that a function receives constant during function execution by using the Safeguard block that is provided in the Component Deployment Guidelines for Embedded Coder Support Package. Insert and connect the safeguard mechanism to:

    • The output port of the root-level inport in the receiving function

    • The input port of the root-level outport in the sending function

  3. If you have not already done so, open the Embedded Coder app.

  4. Add the signal line that connects the function components to the model code mappings.

    1. In the component model, select the signal that connects the functions.

    2. Pause on the ellipsis that appears above or below the signal line to open the action bar. Click the Add Signal button.

      In the Code Mappings editor, on the Signals/States tab, the Signals node expands and lists the signal that you added.

  5. In the Code Mappings editor or by using the code mappings programming interface, configure the code interface for the signal line. At a minimum, set these properties:

    • Storage Class, which controls the appearance and placement of the signal data in the generated code

    • Identifier, which names the model element in the generated code. The code generator uses the identifier in names constructed for access functions.

    • GetFunction and SetFunction, which specifies naming rules for the names of the platform data transfer service functions

    For signal lines that represent a service that uses during-execution communication, use the DuringExecution storage class that is provided in the Component Deployment Guidelines for Embedded Coder Support Package.

Related Topics