Main Content

Communicate with Hardware Using Connected IO

You can use Connected IO to communicate with the IO peripherals on the hardware.

These sections explain:

How Connected IO Works

Connected IO creates a communication interface that enables the Simulink® model and the IO Server to communicate with each other. The Simulink model resides in your computer, and the IO Server is an engine on the hardware that contains all the peripheral functions. The transport layer formats and transmits the data using the communication interface.

This diagram shows the connection that the Connected IO creates between your computer and the hardware.

Communication in Connected IO

When you simulate a Simulink model with Connected IO:

  1. If necessary, you can modify the design by adding, removing, or replacing any block in the Simulink model.

  2. After the model is modified, resimulate the model. During simulation, the data request from the model is communicated to the hardware. You can continue to modify and simulate the model until the expected behavior is achieved.

Connected IO in Model-Based Design

When you simulate a model without Connected IO, Simulink does not communicate with the hardware. Simulink communicates with the hardware only when the code is generated and the model is deployed on the hardware in External mode. Connected IO is an intermediate step in the model-based design workflow that bridges the gap between simulation and code generation by enabling Simulink to communicate with the hardware before deploying the model on the hardware.

This Model-Based Design Workflow diagram displays a model-based workflow:

  1. Create a Simulink model.

  2. Simulate the model in:

    1. Simulation without Connected IO: There is no hardware interaction and no code generation.

    2. Simulation with Connected IO: The model communicates with the hardware. There is no code generation.

    3. External mode (Monitor & Tune): The model is deployed on the hardware and generates code.

  3. Deploy the model to the hardware.

Model-Based Design Workflow

How Connected IO Differs from External Mode

Connected IO and External mode both enable you to communicate with the hardware during simulation. However, you use Connected IO and External mode for different purposes. The table shows the actions that you can perform with each mode.