PortDEMUX Class
The PortDEMUX component is a demultiplexer for CDPPort objects where Index=0 selects the first output port and propagates the connection or data from the input port to the selected output port. More...
Header: | #include <PortDEMUX> |
Inherits: | CDPComponent |
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 PortDEMUX component is a demultiplexer for CDPPort objects where Index=0 selects the first output port and propagates the connection or data from the input port to the selected output port.
PortDEMUX is useful when one needs to switch a single CDPPort into one of the multiple candidates that may use such a port. PortDEMUX supports any CDPPort object. Both data ports and proxy ports are suitable for PortDEMUX usage. Port types used in the demultiplexer should be compatible, allowing any output port to connect to the selected input port.
Signals
Signal | Description |
---|---|
Index | Output port selection where value '0' selects the first added output port for input port connection. Overflow Index values will always fall back to the last output port. |
Parameters
Parameter | Description |
---|---|
InterpolationTime | When local values are used (i.e. NoSwitchDelay detects true), then this parameter can be used to specify the time to interpolate scalar input port output values from the last selected output port input values to the newly selected output 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 PortDEMUX component (depending on the Unit property of the InterpolationTime parameter). Note that InterpolationTime has no effect on string values. |
Properties
Property | Description |
---|---|
NoSwitchDelay | By default, at the demultiplexer 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 demultiplexer tries to auto-add 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). |
EnableForwardProxy | When set, propagates values to all outputs regardless of the DEMUX index selection. See Advanced: Configuring EnableForwardProxy. |
ExcludeFromInterpolation | Semicolon-separated list of port value names to exclude from interpolation (when InterpolationTime is greater than then zero) |
When adding ports with local data to PortDEMUX 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 EnableForwardProxy
When the EnableForwardProxy property is set, values are propagated to all outputs regardless of the DEMUX index selection. This option is useful in redundancy and diverging input and output paths. The Messages flag is meant for enabling propagation of GUI app value changes and the Values flag for regular routed values within the control system. Note, the EnableForwardProxy 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 PortDEMUX with EnableForwardProxy 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 PortDEMUX is used in a component and the lower part shows the implementation inside the PortDEMUX. All the ports inside the PortDEMUX were added as empty ports for easy configuration. The NoSwitchDelay property was also enabled to instruct the PortDEMUX to auto-create all the values at runtime needed for the forward proxy feature to work.
- When using EnableForwardProxy=Messages, follow the Msg nodes on the image above. Setting the Messages flag means that if a GUI application connects to Start.Msg, then changes done in GUI are propagated to both MsgEnd0 and MsgEnd1. Note normal reverse data propagation also still works (as GUI widgets allow two-way value binding). When changing MsgEnd0 (presuming PortMUX.Index=0), the value is propagated to MsgStart (but not MsgEnd1 because value change was not initiated from Start.Msg).
- When using EnableForwardProxy=Values, follow the Val nodes on the image above. When the Values flag is enabled and ValStart is changed, the value is propagated to both ValEnd0 and ValEnd1. Otherwise, when the EnableForwardProxy is disabled, it would have only been propagated to ValEnd0 (presuming PortMUX.Index=0).
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.