How to configure Multiplexer item
This example explains how use a multiplexer to select between a set of input items. The variable type which support this functionality is the item type Multiplexer on the ApisWorker module.
Add worker module
Follow the guide Add Module to Apis Hive to add a module of type ApisWorker to an Apis Hive Instance.
- After adding the module, select the new module named "Worker" from the Solution Explorer.
- Set the "ExchangeRate" property to e.g. 1000 ms. This is the update rate when this module exchanges data with other modules.
- Click on Apply
Add item type Multiplexer
- Follow the guide Add Items to a Module, but this time select item type "Multiplexer".
- Click "Add item(s)"
- Click Ok
Connect Multiplexer item to source item
The numbers of input to select between is given by the external items connected. The first external item (ExternalItem1) is the selector of which port to use as value.
Connect selector item
- Make sure to connect the first item to the input selector item as ExternalItem1
- Right Click on the Multiplexer item and select connect
- Select the item which should be used as selector item. In this case I will use an item called Worker.InputSelector
- The attribute overview of item "_Multiplexter1"_shows that Input selector item "Worker.InputSelector" is connected to ExternalItem1
Select which items to multiplexes between
The different items to multiplex between is given by external items. ExternalItem2 = input1, ..., ExternalItemN = input(N-1)
- Connect Multiplexer item to input1, input2, input3 and input4.
- You should see selector item as ExternalItem1 and the External item 2 to 5 should be the different input items