• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - CDP Core
  • PortMUX
  • 5.0.0

PortMUX Class

The PortMUX component is a multiplexer for CDPPort objects where Index=0 selects the first input port and propagates the connection or data to the output port. More...

Header: #include <PortMUX>
Inherits: CDPComponent
  • List of all members, including inherited members

Reimplemented Public Functions

virtual bool IsReadyToActivate() override
  • 92 public functions inherited from CDPComponent
  • 39 public functions inherited from CDPObject
  • 49 public functions inherited from CDPBaseObject
  • 27 public functions inherited from CDP::StudioAPI::CDPNode
  • 22 public functions inherited from CDP::StudioAPI::ICDPNode

Additional Inherited Members

  • 92 public functions inherited from CDPComponent
  • 39 public functions inherited from CDPObject
  • 49 public functions inherited from CDPBaseObject
  • 27 public functions inherited from CDP::StudioAPI::CDPNode
  • 22 public functions inherited from CDP::StudioAPI::ICDPNode
  • 2 static public members inherited from CDPComponent
  • 6 static public members inherited from CDPObject
  • 1 static public member inherited from CDPBaseObject
  • 12 protected functions inherited from CDPComponent
  • 15 protected functions inherited from CDPObject
  • 1 protected function inherited from CDP::StudioAPI::CDPNode
  • 31 protected variables inherited from CDPComponent
  • 7 protected variables inherited from CDPObject
  • 8 protected variables inherited from CDPBaseObject
  • 1 static protected member inherited from CDPObject

Detailed Description

The PortMUX component is a multiplexer for CDPPort objects where Index=0 selects the first input port and propagates the connection or data to the output port.

PortMUX is useful when one needs to switch between different CDPPorts coming into your component to change the source of control values or data utilized. PortMUX supports any CDPPort object. Both data ports and proxy ports are suitable for PortMux usage. Port types used in the multiplexer should be compatible, allowing any input port to connect to the output port.

To set up the PortMUX multiple input ports and a single output port is required in configuration.

Signals

SignalDescription
IndexInput port selection where value '0' selects the first added input port for output port connection. Overflow Index values will always fall back to the last input port.

Parameters

ParameterDescription
InterpolationTime When local values are used (i.e. NoSwitchDelay detects true), then this parameter can be used to specify the time to interpolate scalar output port output values from the last selected input port input values to the newly selected input port input values. Defaults to zero which means no interpolation will be done (i.e. immediate switchover will be used). Time can be configured either in seconds or in processing cycles of the PortMUX component (depending on the Unit property of the InterpolationTime parameter). Note that InterpolationTime has no effect on string values.

Properties

PropertyDescription
NoSwitchDelay By default, at the multiplexer Index change, a switchover takes several processing cycles to complete. However, when all ports contain local values, the source switch at Index change can be done without any delay as the values can then always be started to be propagated from the right source without actually re-connecting any port. When this property is set, the multiplexer tries to auto-adds all the requested local values to all ports (when not already added). At runtime, the value of this property shows if the no-delay switching was possible to set or not (i.e. if all ports actually have local values).
EnableReverseProxy When set, reverse propagates values through all possible port chain connections regardless of the MUX index selection. See Advanced: Configuring EnableReverseProxy.
ExcludeFromInterpolationSemicolon-separated list of port value names to exclude from interpolation (when InterpolationTime is greater than then zero)

When adding ports with local data to PortMUX the data direction on input ports and output ports must match. The simplest is to think that the data coming in from the input port must go out from the output port and the other way around. Inside the multiplexer, the data connections are made automatically and should not be manually created.

Advanced: Configuring EnableReverseProxy

When the EnableReverseProxy property is set, values are reverse propagated from end to start through all possible port chain connections regardless of the MUX index selection. This option is useful in redundancy and diverging input and output paths. The Messages flag is meant for enabling reverse propagation of GUI app value changes and the Values flag for regular routed values within the control system. Note, the latter only works on data ports (both input and output ports must either use ValuedConnection or be code ports with local properties).

When setting up a PortMUX with EnableReverseProxy turned on, it is important to get right the Input flag of port connections. Here is an image to take as an example. The upper part of the image shows how a PortMUX is used in a component and the lower part shows the implementation inside the PortMUX. All the ports inside the PortMUX were added as empty ports for easy configuration. The NoSwitchDelay property was also enabled to instruct the PortMUX to auto-create all the values at runtime needed for the reverse proxy feature to work.

  • When using EnableReverseProxy=Messages, follow the Msg nodes on the image above. Setting the Messages flag means that if a GUI application connects to End.Msg, then changes done in GUI are reverse propagated to both MsgStart0 and MsgStart1. Note forward data propagation also still works (as GUI widgets allow two-way value binding). When changing MsgStart0 (presuming PortMUX.Index=0), the value is propagated to MsgEnd (but not MsgStart1 because value change was not initiated from End.Msg).
  • When using EnableReverseProxy=Values, follow the Val nodes on the image above. When the Values flag is enabled and ValEnd is changed, the value is propagated to both ValStart0 and ValStart1. Otherwise, when the EnableReverseProxy is disabled, it would have only been propagated to ValStart0 (presuming PortMUX.Index=0).

Member Function Documentation

[override virtual] bool PortMUX::IsReadyToActivate()

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top