This class represents the TriggerOverEthernet (ToE) module which allows the generation of GigE Action Commands.
The GigE Vision v1.1 (GenICam SFNC v1.3) specifies the Action Command message (ACTION_CMD
) which can be used to trigger cameras.
The Action Command messages are generated in the ToE hardware without any influence from the operating system. This means that the trigger signal is carried to the camera(s) over the network without the need of a separate cable. The resulting jitter caused by the switching network is acceptable for most applications.
The Action Command message is implemented using UDP broadcast packets. Therefore, it is possible to trigger multiple cameras at the same time. Furthermore, the Action Command message contains key and mask values to trigger only specific cameras connected on the same network.
The ToE hardware allows the user to define different Action Commands (use GetNumberOfCommands() to get the maximum number of different commands). Every Action Command gets broadcasted on all Ethernet ports supporting the ToE feature.
Follow these steps to use the Action Command feature:
The GigE specification defines the following behavior about the parameters:
The device asserts the selected action signal only if:
This example uses the following setup:
// DigitalInput[0] triggers CommandID[0] > camera 0
// camera parameters are:
//
// CAM0> DeviceKey: 0xABCD
// GroupKey: 0x1
// GroupMask: 0x1
//
// DigitalInput[1] triggers CommandID[1] > camera 1 and 2
// camera parameters are:
//
// CAM1> DeviceKey: 0xABCD
// GroupKey: 0x2
// GroupMask: 0x1
// CAM2> DeviceKey: 0xABCD
// GroupKey: 0x2
// GroupMask: 0x1
//
VIB::Multiplexer multiplexer;
VIB::TriggerOverEthernet triggerOverEth;
// Open devices: Multiplexer and ToE
multiplexer.Open();
triggerOverEth.Open();
// Multiplexer: connect two digital inputs to the line 0 and 1
multiplexer.ConnectOutput(0, VIB::Multiplexer::MUX_SRC_DIG_IN0);
multiplexer.ConnectOutput(1, VIB::Multiplexer::MUX_SRC_DIG_IN1);
// ToE:
// CommandID[0]
triggerOverEth.ConfigureActionCommand(0, 0xABCD, 0x1, 0x1);
// CommandID[1]
triggerOverEth.ConfigureActionCommand(1, 0xABCD, 0x2, 0x1);
This class controls the RTCC Multiplexer which connects signal sources and sinks with each other. Definition VIB_Interface.h:745 @ MUX_SRC_DIG_IN1 DigitalInput unit 0, wire 1. Definition VIB_Interface.h:759 @ MUX_SRC_DIG_IN0 DigitalInput unit 0, wire 0. Definition VIB_Interface.h:758 bool ConnectOutput(unsigned int OutputIndex, Multiplexer::MUX_SOURCE Source) Selects the source signal for the specified output line. Definition Multiplexer.cpp:474 This class represents the TriggerOverEthernet (ToE) module which allows the generation of GigE Action... Definition VIB_Interface.h:1097 bool ConfigureTriggerSource(const unsigned int CommandID, const VIB::TriggerOverEthernet::TOE_ACTIONCOMMAND_SOURCE src, const bool Invert) Selects the source signal for the Action Command for the given command ID. Definition TriggerOverEthernet.cpp:172 @ TOE_SRC_MUX_OUT1 Multiplexer Output 1. Definition VIB_Interface.h:1109 @ TOE_SRC_MUX_OUT0 Multiplexer Output 0. Definition VIB_Interface.h:1108 bool ConfigureActionCommand(const unsigned int CommandID, const unsigned int DeviceKey, unsigned int GroupKey, unsigned int GroupMask) Configures the GigE Action Command parameters for the given command ID. Definition TriggerOverEthernet.cpp:141 Please note that error checking was removed to keep the code as simple as possible. |
Public Types | |
enum | TOE_ACTIONCOMMAND_SOURCE |
The source signal definitions for the Action Command trigger, used by ConfigureTriggerSource() More... |
Public Member Functions | |
bool | ConfigureActionCommand (const unsigned int CommandID, const unsigned int DeviceKey, unsigned int GroupKey, unsigned int GroupMask) |
Configures the GigE Action Command parameters for the given command ID. | |
bool | ConfigureTriggerSource (const unsigned int CommandID, const VIB::TriggerOverEthernet::TOE_ACTIONCOMMAND_SOURCE src, const bool Invert) |
Selects the source signal for the Action Command for the given command ID. | |
bool | GetNumberOfCommands (unsigned int &NumberOfCommands) |
Returns the number of supported Action Commands. | |
bool | Reset () |
Resets the device to default settings. | |
bool | ResetActionCommand (const unsigned int CommandID) |
Disables and clears the configuration for the given command ID. | |
TriggerOverEthernet () | |
Default constructor for the device object. | |
Public Member Functions inherited from VIB::iDevice | |
bool | Close () |
Closes a device. | |
iDevice (const iDevice &device) | |
The copy constructor makes a copy of the existing device object. | |
bool | isOpen (bool &state) |
Returns the open state of a device object. | |
bool | Open (unsigned int Index=0) |
Opens a device. | |
iDevice & | operator= (const iDevice &device) |
The assignment operator makes a copy of the existing device object. | |
virtual | ~iDevice () |
Deletes the device object. |
The source signal definitions for the Action Command trigger, used by ConfigureTriggerSource()
VIB::TriggerOverEthernet::TriggerOverEthernet | ( | ) |
Default constructor for the device object.
The device must be opened with Open() before it can be used.
bool VIB::TriggerOverEthernet::ConfigureActionCommand | ( | const unsigned int | CommandID, |
const unsigned int | DeviceKey, | ||
unsigned int | GroupKey, | ||
unsigned int | GroupMask ) |
Configures the GigE Action Command parameters for the given command ID.
CommandID | Index of the Action Command, 0 ... (GetNumberOfCommands() - 1) |
DeviceKey | GigE Action Device Key |
GroupKey | GigE Action Group Key |
GroupMask | GigE Action Group Mask |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::TriggerOverEthernet::ConfigureTriggerSource | ( | const unsigned int | CommandID, |
const VIB::TriggerOverEthernet::TOE_ACTIONCOMMAND_SOURCE | src, | ||
const bool | Invert ) |
Selects the source signal for the Action Command for the given command ID.
CommandID | Index of the Action Command, 0 ... (GetNumberOfCommands() - 1) |
src | Source signal |
Invert | Polarity of the trigger signal for the Action Command |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::TriggerOverEthernet::GetNumberOfCommands | ( | unsigned int & | NumberOfCommands | ) |
Returns the number of supported Action Commands.
NumberOfCommands | Number of different Action Commands |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::TriggerOverEthernet::Reset | ( | ) |
Resets the device to default settings.
All GigE Action Commands are deactivated and the trigger source is set to Multiplexer output 0.
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::TriggerOverEthernet::ResetActionCommand | ( | const unsigned int | CommandID | ) |
Disables and clears the configuration for the given command ID.
CommandID | Index of the Action Command, 0 ... (GetNumberOfCommands() - 1) |
true
for success, use VIBSystem::GetLastErrorString() for an error description