Block Components

Learn about ports, inputs, outputs, functions and display information in blocks.

Block Ports

Blocks include entry and exit ports that control the input and output of information.

Regular and Activation Ports
A port of a block can be defined as a regular or activation port. A block can have an unlimited number of both types. These ports can appear anywhere on a block, but generally, regular input ports are located on the left side of a block, and regular output ports are on the right, numbered consecutively from top to bottom. Input or output activation ports are located respectively at the top and bottom, numbered from left to right.
Regular and Activation Links
An input and output port of the same type can be connected with a link. Depending on the type of port connected, the link is referred to as a regular link or an activation link. A regular link passes a signal from an output port to an input port during a simulation. This signal constitutes a piece-wise right-continuous, possibly vector or matrix, function of time. An activation link passes control information indicating the time instants when a block on the receiving end should be activated. The activation signal is in general a union of time intervals and isolated points in time that are known as events.

Inputs and Outputs

Inputs and outputs are the flow of information to and from a block via ports.

Input Types
Blocks can have two types of inputs: regular inputs and activation inputs. Regular inputs and outputs are interconnected by regular links, and activation inputs and outputs are interconnected by activation links.
Output Types
Blocks can have two types of outputs: regular outputs and activation outputs. Regular inputs and outputs are interconnected by regular links, and activation inputs and outputs are interconnected by activation links.

Block Functions

Each basic block is defined by two functions, the interfacing function and the simulation function.

Interfacing Function
The interfacing function, written in OML, handles the interactions with the editor. This function specifies what the geometry of the block should be, how many inputs and outputs it should have, and what the block type is. This function involves the user interface in terms of updating the parameters and initializing the states of the block. The interfacing function also checks the validity of block parameters and computes the internal parameters that are to be used by the simulation functions of the block. The interfacing function is generated automatically from the block’s .scb file.
Simulation Function
The simulation function defines behavior such as computing outputs and states of the blocks during a simulation. The simulation function is normally written in C, but can also be written as an OML function.