| Customize Help

Sending a Trigger-over-Ethernet packet without Host intervention



Although both models of Matrox Concord PoE support sending Trigger-over-Ethernet packets as described in Introducing action commands, the Matrox Concord PoE with ToE model can also do so without Host intervention.

Matrox Concord PoE with ToE includes a Trigger-over-Ethernet (ToE) module that can send a Trigger-over-Ethernet packet (action command or GigE Vision software trigger) over Ethernet, upon reception of an internal or external event, without Host intervention. The ToE module reduces latency, jitter, and is useful for applications that require a high degree of trigger accuracy. Since most GigE Vision cameras include a hardware implementation for receiving action commands, sending an action command is likely to provide a better result than sending a GigE Vision software trigger. For an explanation on action commands, see the Introducing action commands subsection of the Triggering simultaneous actions in multiple GigE Vision cameras section of the Matrox GigE Vision driver chapter in the MIL Hardware-specific Notes. If your camera does not support action commands, or does not have hardware implemented for receiving them, then using a GigE Vision software trigger is an alternative option.

Sending a Trigger-over-Ethernet packet as an action command

To configure the ToE module to send a Trigger-over-Ethernet packet as an action command, you follow similar steps as when sending an action command in software. However, you set up the action command on a MIL Concord PoE system instead of a MIL GigE system; you still set up the cameras using digitizers allocated on a MIL GigE system. Specifically:

  1. Allocate a MIL Concord PoE system, using MsysAlloc() with M_SYSTEM_CONCORD_POE.

  2. Allocate a MIL GigE system, using MsysAlloc() with M_SYSTEM_GIGE_VISION. Then, allocate a digitizer on this system for each GigE camera that is physically connected to the Matrox Concord PoE and will receive the action command, using MdigAlloc().

  3. Set up the action command on the MIL Concord PoE system. To do so, make successive calls to MsysControl() with the MIL Concord PoE system identifier and each of the following:

    M_GC_ACTION_DEVICE_KEY to identify the group of cameras to receive the action command.

    M_GC_ACTION_GROUP_MASK to limit which cameras in the group should generate the action signal upon receiving the command. Set this to 0xFFFFFFFF if all cameras in the group should generate the action signal.

    M_GC_ACTION_GROUP_KEY to specify the key corresponding to the internal action signal on the camera.

    M_TRIGGER_SOURCE to specify the event that should cause the action command to be sent (for example, an auxiliary input signal).

  4. Set up the GigE cameras to receive the action command, using successive calls to MdigControlFeature() with their digitizer identifiers (allocated on the MIL GigE system) and each of the following features: ActionDeviceKey, ActionGroupMask, and ActionGroupKey.

  5. Set up the cameras to acquire the next frame upon receiving the action command. To do so, make successive calls to MdigControlFeature() with the camera's corresponding digitizer and each of the following features:

    • The TriggerSelector feature to select the type of trigger to configure (for example, FrameStart).

    • The ActionSelector feature to associate an internal action signal (for example, Action0) with the action group key.

    • The TriggerSource feature to set the trigger source of the frame start to the internal action signal (for example, Action0).

    • The TriggerMode feature to activate triggering the frame start upon the reception of the action command.

  6. Register with MIL the cameras associated with the action command. To do so, make successive calls to MsysControl() with the MIL Concord PoE system, M_ADD_DESTINATION, and each of the MIL digitizers. MIL uses this information to know on which port to send the packet and to track and make use of the camera's action results.

  7. Activate sending a Trigger-over-Ethernet packet as an action command upon the reception of the specified trigger event (for example, an auxiliary input signal). Use MsysControl() with M_TRIGGER_STATE set to M_ENABLE.

The following code snippet demonstrate how to set up the ToE module on Matrox Concord PoE with ToE to send an action command, and how to set the camera to grab a frame upon receiving the action command:

void SetupToEUsingActions(MIL_ID MilConcordPoESystem, const std::vector<ToEDevice>& Devices)
{
  MosPrintf(MIL_TEXT("\nSetting-up GigE Vision devices and the Matrox ConcordPoE board.\n\n"));

  /* Set-up action command on Matrox Concord PoE with ToE */
  MIL_INT DeviceKey = 0x56781234, GroupKey = 0x24, GroupMask = 0xFFFFFFFF;
  MsysControl(MilConcordPoESystem, M_GC_ACTION0 + M_GC_ACTION_DEVICE_KEY, DeviceKey);
  MsysControl(MilConcordPoESystem, M_GC_ACTION0 + M_GC_ACTION_GROUP_MASK, GroupMask);
  MsysControl(MilConcordPoESystem, M_GC_ACTION0 + M_GC_ACTION_GROUP_KEY, GroupKey);
  MsysControl(MilConcordPoESystem, M_GC_ACTION0 + M_TRIGGER_SOURCE, M_AUX_IO2);

  /* Set-up action command on the GigE Vision devices */
  for (size_t i = 0; i < Devices.size(); i++)
  {
    MIL_INT64 ActionNumber = 0;
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("ActionSelector"), M_TYPE_INT64, &ActionNumber);
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("ActionDeviceKey"), M_TYPE_INT64, &DeviceKey);
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("ActionGroupMask"), M_TYPE_INT64, &GroupMask);
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("ActionGroupKey"), M_TYPE_INT64, &GroupKey);

    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("TriggerSelector"), M_TYPE_STRING, MIL_TEXT("FrameStart"));
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("TriggerSource"), M_TYPE_STRING, MIL_TEXT("Action0"));
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("TriggerMode"), M_TYPE_STRING, MIL_TEXT("On"));

    MsysControl(MilConcordPoESystem, M_GC_ACTION0 + M_ADD_DESTINATION, Devices[i].MilDigitizerId);
  }
}

Sending a Trigger-over-Ethernet packet as a GigE Vision software trigger

To configure the ToE module to send a Trigger-over-Ethernet packet as a GigE Vision software trigger, do the following:

  1. Allocate a MIL Concord PoE system, using MsysAlloc() with M_SYSTEM_CONCORD_POE.

  2. Allocate a MIL GigE Vision system, using MsysAlloc() with M_SYSTEM_GIGE_VISION. Then, allocate a digitizer on this system for each GigE Vision camera that should receive the GigE Vision software trigger, using MdigAlloc().

  3. Set up the ToE module to send a Trigger-over-Ethernet packet, as a GigE Vision software trigger, upon a specified event. To do so, make successive calls to MsysControl() with the MIL Concord PoE system identifier and each of the following:

    M_GC_TRIGGER_SOFTWARE0 + M_GC_TRIGGER_SELECTOR to specify the type of trigger that should take place on the cameras upon receiving the Trigger-over-Ethernet packet (for example, frame start).

    M_GC_TRIGGER_SOFTWARE0 + M_TRIGGER_SOURCE to specify the event that should cause the Trigger-over-Ethernet packet (GigE Vision software trigger) to be sent (for example, an auxiliary input signal).

  4. Set up the cameras to receive the Trigger-over-Ethernet packets, using successive calls to MdigControlFeature() with their digitizer identifiers (allocated on the MIL GigE Vision system) and each of the following features:

    • The TriggerSelector feature to select the type of trigger to configure (for example, FrameStart).

    • The TriggerSource feature to set the trigger source of the frame start to Software.

    • The TriggerMode feature to activate triggering the frame start upon the reception of the GigE Vision software trigger.

  5. Specify the cameras that should receive the GigE Vision software trigger. To do so, make successive calls to MsysControl() with the MIL Concord PoE system, M_ADD_DESTINATION, and each of the MIL digitizers.

  6. Activate sending a Trigger-over-Ethernet packet as a GigE Vision software trigger upon the reception of the specified trigger event (for example, an auxiliary input signal). Use MsysControl with M_TRIGGER_STATE set to M_ENABLE.

The following code snippet demonstrate how to set up the ToE module on Matrox Concord PoE with ToE to send a GigE Vision software trigger, and how to set the camera to grab a frame upon receiving the GigE Vision software trigger:

void SetupToEUsingSoftware(MIL_ID MilConcordPoESystem, const std::vector<ToEDevice>& Devices)
{
  MosPrintf(MIL_TEXT("\nSetting-up GigE Vision devices and the Matrox ConcordPoE board.\n\n"));

  /* Set-up GigE software trigger on Matrox Concord PoE with ToE */
  MsysControl(MilConcordPoESystem, M_GC_TRIGGER_SOFTWARE0 + M_TRIGGER_SOURCE, M_TIMER1);
  MsysControl(MilConcordPoESystem, M_GC_TRIGGER_SOFTWARE0 + M_GC_TRIGGER_SELECTOR, MIL_TEXT("FrameStart"));

  /* Set-up GigE software trigger on the GigE Vision devices */
  for (size_t i = 0; i < Devices.size(); i++)
  {
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("TriggerSelector"), M_TYPE_STRING, MIL_TEXT("FrameStart"));
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("TriggerSource"), M_TYPE_STRING, MIL_TEXT("Software"));
    MdigControlFeature(Devices[i].MilDigitizerId, M_FEATURE_VALUE, MIL_TEXT("TriggerMode"), M_TYPE_STRING, MIL_TEXT("On"));

    MsysControl(MilConcordPoESystem, M_GC_TRIGGER_SOFTWARE0 + M_ADD_DESTINATION, Devices[i].MilDigitizerId);
  }

  MsysControl(MilConcordPoESystem, M_GC_TRIGGER_SOFTWARE0 + M_TRIGGER_STATE, M_ENABLE);
}