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);
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. More... | |
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. More... | |
bool | GetNumberOfCommands (unsigned int &NumberOfCommands) |
Returns the number of supported Action Commands. More... | |
bool | Reset () |
Resets the device to default settings. More... | |
bool | ResetActionCommand (const unsigned int CommandID) |
Disables and clears the configuration for the given command ID. More... | |
TriggerOverEthernet () | |
Default constructor for the device object 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... | |
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