Technically speaking, a multiplexer is a multiple changeover switch. In practice, multiplexers are used to switch variable sets. For example, if there is data from several controllers in the PLC, a view can be configured in the application via a multiplexer that displays the data of one controller at a time, but switches between the controllers via a changeover switch.
A typical application of a multiplexer can be shown using the sample driver. This contains three similar data structures (DistillationDevice.Unit1..3), which can be displayed switchably via a multiplexer.
Using a multiplexer simplifies the structure of the application interface. Control elements only need to be configured for one data structure. There is no need to repeatedly place and parameterise control elements that only differ in the variable connection.
Carry out the following steps to insert the necessary variable definitions:


Carry out the following steps to define a multiplexer in the project:
Internal variables normally have an image in the variable server. However, they are not exchanged with a PLC.
In the client-server system, however, it is not desirable for a client to switch the control variable of a multiplexer and for other clients to automatically receive a different view as a result. For this purpose, there is the option Client internal in the variable definition.
Carry out the following steps to create a view in which the display elements switch between the three PLC units:

It takes a few seconds (about 20) for the simulation to display value changes in the sample driver.
When creating the internal variable SwitchDistillationDeviceUnit, you have set the initial value to 1. Bit 0 of this variable set in this way is already colour-coded by the first RadioSwitch element when the project is started. Several RadioSwitch control elements form a field here in which only one element can be active at any one time.
If you now press the other two RadioSwitch controls, you switch the switchover variable to the values 2 or 4. These values were defined as switchover states in the multiplexer definition. Switching switches the data sources of the VarOut controls to the corresponding variables of the namespaces Unit2 and Unit3.