This class controls the Multiplexer unit which connects signal sources and sinks with each other.
The following image gives a simplified overview of the signal path inside the VisionBox.
The multiplexer can be used to connect different FPGA units with each other. The multiplexer provides multiple independent output lines. They can be connected to different source signals, for example a trigger signal coming from the digital input module. The selected output line of the multiplexer can then be used by other FPGA units as input signal, for example by the strobe unit. Each output line can be used by multiple destinations.
The availability of source signals depends on the hardware (e.g. number of installed digital I/O modules) and support by firmware (e.g. number of I/O Schedulers). Selecting a source from a unit which is not present will set the output line to low.
The following source signals are available (see MUX_SOURCE):
The multiplexer output lines can be used by the following units:
|----------------------------------------> digitalOut(0) DigIn(0) --> multiplexer(0) --+ |--> ioScheduler(0) --> multiplexer(1) --> digitalOut(1)The digital input 0 is directly connected to the digital output 0 by using the Multiplexer line 0.
The Multiplexer supports generation of events for the first 16 Multiplexer output lines.
After the desired lines are configured with ConfigureEvent(), the function WaitForEvent() can be used to block execution until a signal change occurs.
Enhancement for RTCC version ≥ 1.0.0.52:
For hardware platforms with watchdog support, the multiplexer output lines can be reset by the watchdog. If the watchdog timer expires, the output lines are reset to the source Multiplexer::MUX_SRC_OFF. The lines can then be reconfigured to different sources again.
Call Service::WatchdogSetup() with Service::SERVICE_WDT_RESET_TYPE_MULTIPLEXER to activate this mode.
Available capabilities depend on the combination of hardware type, software library and FPGA version.
Click the entries below to show the dependencies:
Hardware | Library Version | FPGA Version | Multiplexer lines |
---|---|---|---|
VisionBox AGE-X5 | 1.6.5.6 | 1.0.0.42 | 24 |
VisionBox AGE-X4 / Machine Vision Controller | 1.6.5.5 | 1.0.0.41 | 24 |
1.6.3.0 | 1.0.0.28 | 16 | |
VisionBox AGE-X3 | 1.6.2.0 | 1.0.0.25 | 16 |
VisionBox AGE-X2 | 1.6.5.5 | 1.0.0.40 | 24 |
1.5.1.0 | 1.0.0.21 | 16 | |
1.3.0.0 | 1.0.0.17 | 8 | |
VisionBox DAYTONA | 1.6.8.3 | 1.0.0.46 | 8 |
VisionBox LE MANS | 1.6.5.0 | 1.0.0.31 | 16 |
VisionCam XM | 1.6.4.0 | 1.0.0.30 | 16 |
VisionSensor PV3 + I/O Expansion | 1.7.10.0 | 1.0.0.75 | 16 |
Machine Vision Manager | 1.6.3.0 | 1.0.0.27 | 16 |
Hardware | FPGA Version | Multiplexer::MUX_SOURCE | ||
---|---|---|---|---|
MUX_SRC_SYNC_<0...3> | MUX_SRC_SYNC_1_<0...3> | MUX_SRC_SYNC_2_<0...3> | ||
VisionBox AGE-X5 | 1.0.0.45 | RS-422 IN (first connector) | RS-422 IN (second connector) | - |
1.0.0.44 | no | |||
1.0.0.42 | no | |||
VisionBox AGE-X4 / Machine Vision Controller | 1.0.0.33 | RS-422 IN (first connector) | RS-422 IN (second connector) | RS-422 IN (third connector) |
1.0.0.28 | - | |||
VisionBox AGE-X3 | 1.0.0.25 | - | - | - |
VisionBox AGE-X2 | 1.0.0.17 | RS-422 IN | - | - |
VisionBox DAYTONA | 1.0.0.46 | RS-422 IN | - | - |
VisionBox LE MANS | 1.0.0.31 | RS-422 IN (first connector) | RS-422 IN (second connector) | - |
VisionCam XM | 1.0.0.43 | RS-422 IN | Sensor signals: MUX_SRC_SYNC_1_0: exposure MUX_SRC_SYNC_1_1: frame-valid MUX_SRC_SYNC_1_2: line-valid MUX_SRC_SYNC_1_3: trigger | - |
1.0.0.30 | no | |||
VisionSensor PV3 + I/O Expansion | 1.0.0.75 | RS-422 IN | Sensor signals: MUX_SRC_SYNC_1_0: exposure | - |
Machine Vision Manager (MVM) | 1.0.0.27 | RS-422 IN (first connector) | RS-422 IN (second connector) | - |
Public Types | |
enum | MUX_SOURCE |
Source signal definitions for the Multiplexer More... | |
Public Member Functions | |
bool | AbortWaitingForEvent () |
Aborts all threads waiting for events. More... | |
bool | ConfigureEvent (unsigned int SensitivityMaskRising, unsigned int SensitivityMaskFalling) |
Configures the sensitivity for Multiplexer events. More... | |
bool | ConnectOutput (unsigned int OutputIndex, Multiplexer::MUX_SOURCE Source) |
Selects the source signal for the specified output line. More... | |
bool | GetEventTime (unsigned int &time_us, bool &eventsDropped) |
Reads the event time for the received event. More... | |
bool | GetNumberOfOutputs (unsigned int &NumberOfOutputs) |
Returns number of multiplexer output lines. More... | |
Multiplexer () | |
Default constructor for the device object More... | |
bool | Reset () |
Resets the device to default settings. More... | |
bool | WaitForEvent (unsigned int msTimeout, unsigned int &NewState, unsigned int &ChangedState) |
Waits for a Multiplexer event. More... | |
Public Member Functions inherited from VIB::iDevice | |
bool | Close () |
Closes a device More... | |
iDevice (const iDevice &device) | |
The copy constructor makes a copy of the existing device object More... | |
bool | isOpen (bool &state) |
Returns the open state of a device object More... | |
bool | Open (unsigned int Index=0) |
Opens a device More... | |
iDevice & | operator= (const iDevice &device) |
The assignment operator makes a copy of the existing device object More... | |
virtual | ~iDevice () |
Deletes the device object More... | |
Source signal definitions for the Multiplexer
VIB::Multiplexer::Multiplexer | ( | ) |
Default constructor for the device object
The device must be opened with Open() before it can be used.
bool VIB::Multiplexer::AbortWaitingForEvent | ( | ) |
Aborts all threads waiting for events.
The function wakes up all threads waiting in WaitForEvent(), which will then return with an error.
bool VIB::Multiplexer::ConfigureEvent | ( | unsigned int | SensitivityMaskRising, |
unsigned int | SensitivityMaskFalling | ||
) |
Configures the sensitivity for Multiplexer events.
This function must be called before WaitForEvent().
The parameters SensitivityMaskRising and SensitivityMaskFalling specify which of the first 16 Multiplexer output lines will be used to generate events. The signal edge can be specified for each line individually.
SensitivityMaskRising | Binary representation of Multiplexer signals that triggers an event on the rising edge |
SensitivityMaskFalling | Binary representation of Multiplexer signals that triggers an event on the falling edge |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Multiplexer::ConnectOutput | ( | unsigned int | OutputIndex, |
Multiplexer::MUX_SOURCE | Source | ||
) |
Selects the source signal for the specified output line.
OutputIndex | Output number, 0 ... (GetNumberOfOutputs() - 1) |
Source | Source for the output |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Multiplexer::GetEventTime | ( | unsigned int & | time_us, |
bool & | eventsDropped | ||
) |
Reads the event time for the received event.
This function can be called after an event was returned by WaitForEvent(). It returns the number of microseconds between the previous and the current event. The function also returns a flag indicating an overflow of the event FIFO.
Restrictions
time_us | Event time in microseconds, 0...0xffffff |
eventsDropped | Indicates that events were dropped before this event |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Multiplexer::GetNumberOfOutputs | ( | unsigned int & | NumberOfOutputs | ) |
Returns number of multiplexer output lines.
See also Hardware, library and firmware dependencies.
NumberOfOutputs | Number of outputs |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Multiplexer::Reset | ( | ) |
Resets the device to default settings.
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::Multiplexer::WaitForEvent | ( | unsigned int | msTimeout, |
unsigned int & | SignalState, | ||
unsigned int & | EventSignals | ||
) |
Waits for a Multiplexer event.
The function waits for events on multiplexer lines which are selected with ConfigureEvent(). The function blocks until a line event occurs, the timeout expires, or AbortWaitingForEvent() gets called.
msTimeout | Timeout in milliseconds, 1 ... INFINITE The actual timeout may be twice as high if there are already other threads waiting for an event. |
SignalState | After success, the function returns the current state of the first 16 Multiplexer lines (binary representation). |
EventSignals | After success, the function returns the Multiplexer lines which triggered the event (binary representation). |
true:
success, new event false:
timeout, abort or other errors; use VIBSystem::GetLastErrorString() for an error description