CogNdm TriggerSoftEventOff EventCognex VisionPro 9.22
The NDM raises the TriggerSoftEventOff event to tell the vision system that the soft event trigger bit has been reset.

Handle this event and use the SoftEventID property of the event args to determine which soft event has been reset.

Namespace: Cognex.VisionPro.Comm
Assembly: Cognex.VisionPro.Comm (in Cognex.VisionPro.Comm.dll) Version: 87.0.0.0
Syntax

public virtual event CogNdmTriggerSoftEventOffEventHandler TriggerSoftEventOff

Value

Type: Cognex.VisionPro.Comm CogNdmTriggerSoftEventOffEventHandler
Remarks

Soft Events provide a mechanism for sending general purpose binary signals from the remote device to the vision system. The NDM provides 32 individual Soft Events signals which are uniquely identified by their indices (0-31). The remote device and the vision system can assign specific meanings to the each Soft Event signal based on what is useful to their application context.

To use a Soft Event, the remote device asserts one of the "Soft Event [0-31]" signals high. When the vision system sees this signal transition, the NDM raises the TriggerSoftEvent event. Your vision system code can optionally handle this .NET event and perform any processing that might be necessary.

Your event handler code should use the SoftEventID property of the event args to identify which of the 32 Soft Event signals was received.

Additionally, your vision system event handler code should set the ResponseCode property of the event args to signal to the remote device whether the vision system has finished processing the Soft Event when the event handler returns, or if the soft event processing will continue asynchronously after your event handler code returns.

If you the set the ResponseCode property of the event args to Finshed, the NDM will automatically notify the remote device by sending the appropriately indexed "Soft Event Ack" signal.

If you set the ResponseCode property of the event args to NotFinshed, The NDM will wait until you call the CogNDM's NotifyAsyncSoftEventComplete(Int64, Int32) method before sending the corresponding "Soft Event Ack" to the remote device.

Note that if you are processing soft events asynchronously you must save the MessageID from the event args so that you can latter pass it to the NDM's NotifyAsyncSoftEventComplete(Int64, Int32) method to notify the remote device that soft event processing is complete.

In both the synchronous and asynchronous cases the remote device should send/assert the "Soft Event" signal high. Then wait to receive to receive the "Soft Event Ack" signal while the vision system is processing the soft event. Once the remote device sees the "Soft Event Ack" signal go high, it can then set the original "Soft Event" signal low.

When the remote device sets a "Soft Event" signal low the vision system is signaled via the NDM's TriggerSoftEventOff event. Your vision system code can optionally handle this event. After any user event handler code returns, the NDM automatically notifies the remote device by setting the "Soft Event Ack" signal low. Once the remote device sees the "Soft Event Ack" signal go low, it knows that it is now safe to signal another instance of the same soft event.

Note that the NDM's soft event signals are supported by the Comm Card's precision i/o event system. You can configure the NDM soft events signals to automatically cause a CogPrioEvent directly on the Comm Card's real time processor without involving the host OS. This is primarily useful if you need to deterministically set or pulse a discrete output line based on a soft event signal from the remote device.

See Also