Creating a Continuous Time Block in C Code

  1. In the Component Manager, select a folder for the new block.
  2. In the Insert menu, point to Continuous Time Block and select C Code.
  3. Type in a name for the component and press <Enter>.
  4. Do one of the following:

    • In the Edit menu, select Open Component.
    • Press <Enter>.
    • In the "Database" / "Workspace" list, double-click the component name.

    The C code editor for CT blocks opens.

  5. Select direct or nondirect from the Block Behavior combo box in the toolbar.

    CT blocks specified in C code support either direct or nondirect outputs, but not both. You can set this in the Block Behavior combo box. If you selected direct, only the directOutputs method is available; with nondirect, only the nondirectOutputs method is available. See Algebraic Loops for details on direct and nondirect outputs.

  6. Enter the code or import external modules as required.

Note

Using the C code editor is described in detail in C Code Editor.

See also

C Code Editor

Algebraic Loops