Manual switch

Pick an input with a parameter. 1 uses the top input.

  • signal
  • Gradara equations
  • 3 ports
  • 1 parameter
BlockManual switchKindmanualSwitchLibraryRouting

Description

Passes one of two inputs chosen by a parameter. Use it to try alternatives between runs without rewiring.

Example

Switches A switch that follows a control signal, and a manual switch set by a parameter.

Ramp−1ControlSwitchManual switch
In Gradara, select a Manual switch block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:ConstantRampPulseSwitch

Ports

Inputs 2

  • 1u1

    Input 1, passed when Select is 1.

  • 2u2

    Input 2, passed when Select is 2.

Outputs 1

  • y

    Output signal.

Parameters

  • Select 1 or 2sel1

    ≥ 1

    Which input to pass: 1 or 2. Values below 1.5 select input 1; 1.5 and above select input 2.

Equations

Modelica
y = u2 if sel ≥ 1.5
y = u1 otherwise

Implementation

The block’s Modelica model
y = if sel >= 1.5 then u2 else u1;

Assumptions and limitations

  • The choice is fixed during a run. To switch during a run, use Switch.

Tips

  • Both inputs must still be connected: an unconnected input is an error even when it is not selected.

See also

Select a block in Gradara and press F1 to open its page offline.