SendActionCommand
Top  Previous  Next

Description

Broadcasts the action command to all available network interfaces


Syntax


[VB]
objActiveGige.SendActionCommand DeviceKey, GroupKey[, GroupMask, WaitForAck, SceduledTime]


[C/C++]
HRESULT SendActionCommand (long DeviceKey, long GroupKey, long GroupMask, short WaitForAck, double ScheduledTime)


Data Types
[VB]

DeviceKey, GroupKey, GroupMask: Long
WaitForAck: Integer
ScheduledTime: Double


Parameters
[C/C++]

DeviceKey [in]  
The 32-bit value of the device key in the action command. In order for the action command to be asserted by a device, this parameter should match the device's device key. The device key on the device are typically configured using the ActionDeviceKey feature of the GenICam interface or via the SetDeviceKey method of ActiveGigE.  
GroupKey [in]  
The 32-bit value of the group key in the action command. In order for the action command to be asserted by a device, this parameter should match the device's group key for at least one action supported by the device. The group keys on the device are typically configured using the ActionGroupKey feature of the GenICam interface or via the SetActionConditions method of ActiveGigE. Different actions on the device can be assigned different group keys.  
GroupMask [in]  
The 32-bit value of the group mask in the action command. In order for the action command to be asserted by a device, the result of the AND-wise application of this mask against the device's group mask must be non-zero. The group masks on the device are typically configured using the ActionGroupKey feature of the GenICam interface or via the SetActionConditions method of ActiveGigE. Different actions on the device can be assigned different group masks. The default value of this parameter is 0xFFFFFFFF.  
WaitForAck [in]  
The number of expected acknowledge responses from devices. Each devices which asserts the action command sends an acknowledge response back to the application. If no acknowledgements are received within the Action timeout period or the amount received is less than the value of this parameter, ActiveGigE will resend the Action command. If no acknowledgments are received after all Action retry attempts have been exhausted, SendActionCommands will return an error. If the value of WaitForAck is set to zero, no acknowledge responses will be requested from devices and the method will return immediately.  
ScheduledTime [in]  
The double value indicating the scheduled time of the action in seconds. The time must be in the same time domain as the device's timestamps. Upon receiving a scheduled action command, the device will put it in its action queue and perform the associated action as close to the scheduled timestamp as possible. If the device does not support the scheduled action functionality or if this parameter is zero (default value), the device will execute the action command upon reception.  


Return Values


S_OK  
Success  
E_FAIL  
The application has not received the requested amount of acknowledge responses.  

Example

The following VB example configures two camera for the same action conditions and broadcasts an action command to trigger a frame acquisition on both cameras. Both cameras are assumed to have the software trigger function linked to the "Action1" task.

Private Sub
 Form_Load()
ActiveGigE1.SetDeviceKey 24
ActiveGigE1.SetActionConditions 1,11,7
ActiveGigE1.SetFeature "TriggerSource","Action1"
ActiveGigE1.Trigger=
True

ActiveGige1.Acquire=
True

ActiveGigE2.SetDeviceKey 24
ActiveGigE2.SetActionConditions 1,11,7
ActiveGigE2.SetFeature "TriggerSource","Action1"
ActiveGigE2.Trigger=
True

ActiveGige2.Acquire=
True

End Sub


Private Sub
 OnButtonActionCommand()
ActiveGigE1.SendActionCommand 24,11,7
End Sub

Remarks

The following four conditions must be met for an action command to be asserted by the device:
1) ActiveGigE or a third-party application/receiver must have a master control over the device.  
2) The DeviceKey parameter of the SendActionCommand and the Device Key assigned to the device must be equal.  
3) The GroupKey parameter of the SendActionCommand and the Group Key assigned to the corresponding device action must be equal.  
4) The logical AND-wise operation of the GroupMask parameter of the SendActionCommand and the Group Mask assigned to the corresponding device action must be non-zero. In other words, they must have at least one common bit at the same position.  
 
The Timeout Period and the number of Retry Attempts for Action commands can be configured in the Advanced panel of the GEV Configurator.

You can get the amount of acknowledge responses received from devices and their associated IP addresses by calling GetActionAcknowledgeInfo.
 
Note that scheduled action commands can only be supported by devices compliant with the GigE Vision 2.x specifications. A typical application of this functionality is to simultaneously trigger multiple devices which are using the IEEE 1588 Precision Time Protocol (PTP) for the clock synchronization. The precision achievable in such a setup can be as high as 1 microsecond. For more information refer to "GigE Vision Video Streaming and Device Control Over Ethernet Standard, version 2.0" published by the Automated Imaging Association.