Full Library / Defining_Flow / Switching / Persistant Switch
Block Name: Persistant Switch
- public class Persistant Switch
- extends TypedAtomicActor
- This block has two input ports, the input port for incoming data tokens, and the control port to select the output data path. This block routes the input tokens to either true_output or the false_output based on the boolean value of the control port value. This block has an initial memory (switch_State_Value) that is set to either 'True' or 'False'. All incoming tokens are placed on the port select by this initial Switch_State_Value. This Switch_State_Value is overwritten by the first control token. After the first control value has been received, this block behaves similar to the Switch_Basic. After that the input token is routed based on the value on the control port. If no token has been received on the control port, then the input token is dropped. The control port value can be int/long (0 or 1) and Boolean (TRUE or FALSE). 0 and TRUE places the DS on the true_output port while 1 and FALSE places the data on the false_output port. The input token can be of any data type (int, long, double, array, boolean or Data Structure)
input
public TypedIOPort input
- Input port for data tokens.
control
public TypedIOPort control
- Input port for control tokens, which selects the output true, or output false port. The type is boolean, int or long.
true_output
public TypedIOPort true_output
- Output port, true path, type same as input.
false_output
public TypedIOPort false_output
- Output port, false path, type same as input.
Initial_Switch_State
public StringAttribute Initial_Switch_State
- Initial Switch State, true or false
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents