Output switch

Updated at:

This topic describes the output switch component.

Feature description

The output switch component selects one of two values to output based on a rule.

Calculation logic

  • When the flag is 0 or False, the component's target output is the value of inA. If a switch from inB to inA occurs, the component switches at the ToA rate until the transition is complete. If no switch occurs, the component directly outputs the value of inA.

  • When the flag is 1 or True, the component's target output is the value of inB. If a switch from inA to inB occurs, the component switches at the ToB rate until the transition is complete. If no switch occurs, the component directly outputs the value of inB.

Note

The target value is not necessarily the final output value. It is the value that the output transitions toward, either inA or inB. If the switch rate is extremely high, the component directly outputs the target value.

Parameters

Data point port - Input parameters

Parameter name

Description

Required

Input data type

Data source type

inA

Data point A

Yes

Integer or float

Note

If non-numeric data exists, an exception is thrown.

Any

inB

Data point B

Yes

Integer or float

Note

If non-numeric data exists, an exception is thrown.

Any

Flag port - Input parameters

Parameter name

Description

Required

Input data type

Data source type

in

Flag

Note

A flag value of 0 or false switches the output to data point A. A value of 1 or true switches the output to data point B.

Yes

Integer or Boolean

Note

An exception is thrown if the data contains integers or Booleans.

Unlimited

Output port - Output parameters

Parameter Name

Description

Output data type

out

Output variable

Float

Other parameters

Parameter

Description

Required

Default value

Parameter range

ToA rate

The rate of change per minute when switching from B to A.

Yes

1.0

[-99999999, 99999999]

ToB rate

The rate of change per minute when switching from A to B.

Yes

1.0

[-99999999, 99999999]

Output quality code description

The output quality code is 192.