VisionBox Interface Library  1.7.9.0 (2023-09-08)
VIB::TriggerOverEthernet Class Reference
+ Inheritance diagram for VIB::TriggerOverEthernet:

Detailed Description

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:

  1. Check that the used camera supports the GigE Action Command feature.
  2. Configure the following camera registers: Action Device Key, Action Group Key and Action Group Mask. Use the API from your camera manufacturer.
  3. Prepare the VisionBox module with the selected parameters by calling ConfigureActionCommand().
  4. Select the trigger signal which is used to generate the Action Command with ConfigureTriggerSource(). The signals are delivered from the Multiplexer.
  5. Configure the camera to use the specified Action Command as trigger source.

The GigE specification defines the following behavior about the parameters:
The device asserts the selected action signal only if:

  • the Action Device Key is equal to the key in the action command packet
  • the Action Group Key is equal to the key in the action command packet
  • the logical AND-wise operation of the Action Group Mask with the mask in the action command packet is non-zero
+ Example code

This example uses the following setup:

  • Three compatible GigE cameras are connected to the Smart NIC with ToE support
  • One camera is triggered by the first digital input
  • Two cameras are triggered simultaneous by the second digital input
  • The cameras have to be configured to use GigE Action Command as trigger with the parameters listed below
// 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
// 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...
 
iDeviceoperator= (const iDevice &device)
 The assignment operator makes a copy of the existing device object More...
 
virtual ~iDevice ()
 Deletes the device object More...
 

Member Enumeration Documentation

◆ TOE_ACTIONCOMMAND_SOURCE

The source signal definitions for the Action Command trigger, used by ConfigureTriggerSource()


Enumerator
TOE_SRC_MUX_OUT0 

Multiplexer Output 0.

TOE_SRC_MUX_OUT1 

Multiplexer Output 1.

TOE_SRC_MUX_OUT2 

Multiplexer Output 2.

TOE_SRC_MUX_OUT3 

Multiplexer Output 3.

TOE_SRC_MUX_OUT4 

Multiplexer Output 4.

TOE_SRC_MUX_OUT5 

Multiplexer Output 5.

TOE_SRC_MUX_OUT6 

Multiplexer Output 6.

TOE_SRC_MUX_OUT7 

Multiplexer Output 7.

TOE_SRC_MUX_OUT8 

Multiplexer Output 8.

TOE_SRC_MUX_OUT9 

Multiplexer Output 9.

TOE_SRC_MUX_OUT10 

Multiplexer Output 10.

TOE_SRC_MUX_OUT11 

Multiplexer Output 11.

TOE_SRC_MUX_OUT12 

Multiplexer Output 12.

TOE_SRC_MUX_OUT13 

Multiplexer Output 13.

TOE_SRC_MUX_OUT14 

Multiplexer Output 14.

TOE_SRC_MUX_OUT15 

Multiplexer Output 15.

Constructor & Destructor Documentation

◆ TriggerOverEthernet()

VIB::TriggerOverEthernet::TriggerOverEthernet ( )

Default constructor for the device object

The device must be opened with Open() before it can be used.

Member Function Documentation

◆ ConfigureActionCommand()

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.

Parameters
CommandIDIndex of the Action Command, 0 ... (GetNumberOfCommands() - 1)
DeviceKeyGigE Action Device Key
GroupKeyGigE Action Group Key
GroupMaskGigE Action Group Mask
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ ConfigureTriggerSource()

bool 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.

Parameters
CommandIDIndex of the Action Command, 0 ... (GetNumberOfCommands() - 1)
srcSource signal
InvertPolarity of the trigger signal for the Action Command
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ GetNumberOfCommands()

bool VIB::TriggerOverEthernet::GetNumberOfCommands ( unsigned int &  NumberOfCommands)

Returns the number of supported Action Commands.

Parameters
NumberOfCommandsNumber of different Action Commands
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ Reset()

bool 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.

Returns
true for success, use VIBSystem::GetLastErrorString() for an error description

◆ ResetActionCommand()

bool VIB::TriggerOverEthernet::ResetActionCommand ( const unsigned int  CommandID)

Disables and clears the configuration for the given command ID.

Parameters
CommandIDIndex of the Action Command, 0 ... (GetNumberOfCommands() - 1)
Returns
true for success, use VIBSystem::GetLastErrorString() for an error description
VIB::TriggerOverEthernet::TOE_SRC_MUX_OUT1
@ TOE_SRC_MUX_OUT1
Multiplexer Output 1.
Definition: VIB_Interface.h:1101
VIB::Multiplexer::MUX_SRC_DIG_IN0
@ MUX_SRC_DIG_IN0
DigitalInput unit 0, wire 0.
Definition: VIB_Interface.h:751
VIB::TriggerOverEthernet::ConfigureTriggerSource
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
VIB::Multiplexer::ConnectOutput
bool ConnectOutput(unsigned int OutputIndex, Multiplexer::MUX_SOURCE Source)
Selects the source signal for the specified output line.
Definition: Multiplexer.cpp:433
VIB::TriggerOverEthernet
This class represents the TriggerOverEthernet (ToE) module which allows the generation of GigE Action...
Definition: VIB_Interface.h:1089
VIB::Multiplexer::MUX_SRC_DIG_IN1
@ MUX_SRC_DIG_IN1
DigitalInput unit 0, wire 1.
Definition: VIB_Interface.h:752
VIB::Multiplexer
This class controls the Multiplexer unit which connects signal sources and sinks with each other.
Definition: VIB_Interface.h:738
VIB::TriggerOverEthernet::TOE_SRC_MUX_OUT0
@ TOE_SRC_MUX_OUT0
Multiplexer Output 0.
Definition: VIB_Interface.h:1100
VIB::TriggerOverEthernet::ConfigureActionCommand
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
VIB::iDevice::Open
bool Open(unsigned int Index=0)
Opens a device
Definition: iDevice.cpp:109