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 <ComponentLib/PortDEMUX.h> |
Inherits: | CDPComponent |
Additional Inherited Members
- 90 public functions inherited from CDPComponent
- 37 public functions inherited from CDPObject
- 46 public functions inherited from CDPBaseObject
- 26 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
- 13 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
- 9 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.
Note the following features are only available when the DEMUX contains data ports (ports that either use ValuedConnections or are code ports with local properties):
- NoSwitchDelay - when the demultiplexer Index changes, normally the port reconnection will occur and that takes several cycles to complete. However, with data ports that only contain local properties, data is propagated without actually connecting the ports and starting the same cycle the Index changes.
- EnableForwardProxy - when set, propagates values to all outputs regardless of the DEMUX index selection. See Advanced: Configuring EnableForwardProxy.
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. |
Properties
Property | Description |
---|---|
NoSwitchDelay | Is set runtime when Ports in multiplexer all have local data properties and no-delay switching is possible. |
EnableForwardProxy | When set, propagates values to all outputs regardless of the DEMUX index selection. See Advanced: Configuring EnableForwardProxy. |
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 connections within ports are of type ValuedConnection to enable NoSwitchDelay and to support forward proxy of values and messages.
- 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.