CogNdm ClassCognex VisionPro 9.7
The Network Data Model (NDM) class supports sending and receiving messages between the vision system and a remote device (usually a PLC) over an Ethernet based Factory Floor Protocol (FFP).

The Network Data Model (NDM) is the way Cognex Vision Systems interact with a PLC.

Note: The instance number for the Rockwell Input Assembly is 11 and for the Output Assembly is 21.

Inheritance Hierarchy

System Object
  Cognex.VisionPro.Comm CogNdm
    Cognex.VisionPro.Comm CogNdmEip
    Cognex.VisionPro.Comm CogNdmProfinet
    Cognex.VisionPro.Comm CogNdmSlmp

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

public class CogNdm : ICogPrioFfpEventEnabler, IDisposable

The CogNdm type exposes the following members.

Methods

  NameDescription
Public methodDispose 
Protected methodDispose(Boolean)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Overrides Object Finalize .)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetProtocolConnectionStatus
Gets the connection status for the specified protocol.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNotifyAcquisitionComplete
Notify the remote device (PLC) that an acquisition has completed. You must call this method to notify the PLC when an an acquisiton is complete. If you do not call this function the Trigger Ready bit will never get re-enabled an no more acquisitions can occur.
Public methodNotifyAcquisitionDisabled
Optionally notify the remote device (PLC) that the Vision System is unable to receive acquisition triggers.
Public methodNotifyAcquisitionError
Notify the remote device (PLC) that an acquisition error has occurred.
Public methodNotifyAcquisitionMovePart
Optionally notify the remote device (PLC) that the exposure is complete or the strobe has fired and it is now safe to move the part from the field of view.
Public methodNotifyAcquisitionReady
Notify the remote device (PLC) that the Vision System is ready to receive the first acquisition trigger.
Public methodNotifyAcquisitionStarted
Optionally notify the remote device (PLC) that an acquisition has started.
Public methodNotifyAsyncSoftEventComplete
Notify the remote device (PLC) that an asynchronous soft event has completed.
Public methodNotifyError
Notify the remote device (PLC) that the Vision System has encountered an error.
Public methodNotifyInspectionComplete(CogNdmInspectionResult)
Notify the remote device (PLC) that an inspection has finished.
Public methodNotifyInspectionComplete(Int32, CogNdmUsedAcquisitionIDCollection, Boolean, Int32,  Byte , Int32)
Notify the remote device (PLC) that an inspection has finished.
Public methodNotifyJobState
Notify the remote device (PLC) which job is loaded.
Public methodNotifyRunning
Notify the remote device (PLC) that the Vision System is running or "online".
Public methodNotifyStopped
Notify the remote device (PLC) that the Vision System stopped running or gone "offline".
Public methodNotifySystemStatus
Notifies the remote device (PLC) of the Vision System status.
Public methodReadUserData
Reads user data sent from the remote device (PLC) to the vision system.

Values returned from this function will not reflect changes to the user data present on the remote system until the remote system signals the vision system that new user data is available by sendng a "Set User Data" signal.

Public methodStart
Start the Network Data Model (NDM). Calling Start() opens network sockets and allows connections from a remote device (PLC). You must call Start() on a CogNdm instance returned from CreateNetworkDataModel  in order for the NDM to connect to a remote device (PLC).
Public methodStop
Stop the Network Data Model (NDM). Closes all connections and prevents further connections from being established.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Events

  NameDescription
Public eventClearError
The NDM raises the ClearError event to inform the vision system that the remote device has been notified of an error reported by the vision system and the error has been be cleared.

Handle this event to know when the remote device has acknowledged an error and normal operation can continue.

Public eventJobChangeRequested
The NDM raises the JobChangeRequested event to inform the vision system that the remote device has requested a job change.

Handle this event and use the JobID and JobSlot properties of the event args to determine which job to load and where.

Public eventNewUserData
The NDM raises the NewUserData event to tell the vision system that new user data has arrived from the remote device.

Handle this event and call ReadUserData(Int32, Int32) to read the new user data.

Note that changes to the user data present on the remote device cannot be read until the remote device signals the vision system that new user data is available by sending a "Set User Data" signal.

The remote device can send separate "Set User Data" signals for each user data channel. Use the ChannelIndex property of the event args to determine which "Set User Data" signal was received.

Upon returning from the event handler, the remote device is automatically notified by sending the “Set User Data Ack” signal.

Public eventOfflineRequested
The NDM raises the OfflineRequested event to tell the vision system that it should go offline.

Handle this event and use the ReturnToPreviousState property of the event args to determine whether to transition the vision system offline or return it to its previous state.

Public eventProtocolStatusChanged
The NDM raises the ProtocolStatusChanged event to inform the vision system that the status of the underlying protocol has changed.

Handle this event and use the RemoteAddress and ProtocolStatus properties of the event args to determine how the protocol status has changed.

Public eventTriggerAcquisition
The NDM raises the TriggerAcquisition event to inform the vision system that the remote device has requested an image Acquisition.

Handle this event and use the CameraIndex property of the event args to determine which camera should perform the image acquisition.

Set the ResponseCode property of the event args to notify the remote device if an acquisition error has occurred.

Public eventTriggerAcquisitionDisabledError
The NDM raises the TriggerAcquisitionDisabledError event to tell the vision system that an acquisition trigger was set but the acquisition trigger was not enabled.
Public eventTriggerAcquisitionNotReadyError
The NDM raises the TriggerAcquisitionNotReadyError event when the remote device asserts a "Trigger Camera" signal high without waiting for the vision system to signal that it's ready to receive triggers by setting the "Trigger Ready" signal high.

Handle this event and use the CameraIndex to identify which camera channel was triggered before it was ready.

Your user code should call NotifyAcquisitionComplete(Int32, Int32) to signal that the vision system that it has completed the current acquisition and is ready to receive another "Trigger Camera" signal from the remote device.

Public eventTriggerAcquisitionStop
The NDM raises the TriggerAcquisitionStop event to tell the vision system that the Acquisition trigger has been reset.

Handle this event and use the CameraIndex property of the event args to determine which camera trigger was reset.

Public eventTriggerSoftEvent
The NDM raises the TriggerSoftEvent event to inform the vision system that the remote device has requested that a soft event execute.

Handle this event and use the SoftEventID property of the event args to determine which soft event should execute.

Set the ResponseCode property of the event args to notify the remote device of the status of the soft event when the event handler returns.

Public eventTriggerSoftEventOff
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.

Top
Remarks

NDM Status Signal Table (Status signals are signals sent from the Vision System to the PLC)
+----------------------------------------------------------------------------------------------------------+
¦        ¦ Bit 7     ¦ Bit 6       ¦ Bit 5     ¦ Bit 4       ¦ Bit 3      ¦ Bit 2   ¦ Bit 1    ¦ Bit 0     ¦
+----------------------------------------------------------------------------------------------------------+  ---
¦ 0      ¦ Online    ¦               Offline                 ¦ Rsvd       ¦ Rsvd    ¦ System   ¦ System    ¦     |
¦        ¦           ¦               Reason                  ¦            ¦         ¦ Busy     ¦ Ready     ¦  S  |
+----------------------------------------------------------------------------------------------------------+  y  |
¦ 1      ¦ General   ¦ Rsvd        ¦ Job Load  ¦ Rsvd        ¦ Rsvd       ¦ Rsvd    ¦ Rsvd     ¦ Rsvd      ¦  s  |
¦        ¦ Fault     ¦             ¦ Completed ¦             ¦            ¦         ¦          ¦           ¦  t  |
+----------------------------------------------------------------------------------------------------------+  e  |
¦ 2      ¦                                  Reserved                                                       ¦  m  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 3      ¦                                  Reserved                                                       ¦  S  |
+----------------------------------------------------------------------------------------------------------+  t  |
¦ 4-5    ¦                                  Current Job ID                                                 ¦  a  |
+----------------------------------------------------------------------------------------------------------+  t  |
¦ 6-7    ¦                                  Error ID                                                       ¦  u  |
+----------------------------------------------------------------------------------------------------------+  s  |
¦ 8-11   ¦                                  Soft Event Ack 0-31                                            ¦     |
+----------------------------------------------------------------------------------------------------------+     |
¦ 12-15  ¦                                  Reserved                                                       ¦     |
+----------------------------------------------------------------------------------------------------------+  ---
¦ 16     ¦ Results   ¦ Inspection  ¦ Results   ¦ Inspection  ¦ Exposure   ¦ Acq     ¦ Trigger  ¦ Trigger   ¦     |
¦        ¦ Buffer    ¦ Passed 0    ¦ Valid 0   ¦ Completed 0 ¦ Complete 0 ¦ Error 0 ¦ Ack      ¦ Ready     ¦  E  |
¦        ¦ Overrun 0 ¦             ¦           ¦             ¦            ¦         ¦ Camera 0 ¦ Camera 0  ¦  n  |
+----------------------------------------------------------------------------------------------------------+  g  |
¦ 17     ¦ Rsvd      ¦ Rsvd        ¦ Rsvd      ¦ Rsvd        ¦ Rsvd       ¦ Rsvd    ¦ Rsvd     ¦ Set       ¦  i  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ UserData  ¦  n  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ Ack 0     ¦  e  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 18-19  ¦                                  Acquisition ID 0                                               ¦  0  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 20-21  ¦                                  Inspected Image ID 0                                           ¦     |
+----------------------------------------------------------------------------------------------------------+     |
¦ 22-23  ¦                                  Inspection Result Code 0                                       ¦     |
+----------------------------------------------------------------------------------------------------------+  ---
¦ 24     ¦ Results   ¦ Inspection  ¦ Results   ¦ Inspection  ¦ Exposure   ¦ Acq     ¦ Trigger  ¦ Trigger   ¦     |
¦        ¦ Buffer    ¦ Passed 1    ¦ Valid 1   ¦ Completed 1 ¦ Complete 1 ¦ Error 1 ¦ Ack      ¦ Ready     ¦  E  |
¦        ¦ Overrun 1 ¦             ¦           ¦             ¦            ¦         ¦ Camera 1 ¦ Camera 1  ¦  n  |
+----------------------------------------------------------------------------------------------------------+  g  |
¦ 25     ¦ Rsvd      ¦ Rsvd        ¦ Rsvd      ¦ Rsvd        ¦ Rsvd       ¦ Rsvd    ¦ Rsvd     ¦ Set       ¦  i  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ UserData  ¦  n  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ Ack 1     ¦  e  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 26-27  ¦                                  Acquisition ID 1                                               ¦  1  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 28-29  ¦                                  Inspected Image ID 1                                           ¦     |
+----------------------------------------------------------------------------------------------------------+     |
¦ 30-31  ¦                                  Inspection Result Code 1                                       ¦     |
+----------------------------------------------------------------------------------------------------------+  ---
¦ 32     ¦ Results   ¦ Inspection  ¦ Results   ¦ Inspection  ¦ Exposure   ¦ Acq     ¦ Trigger  ¦ Trigger   ¦     |
¦        ¦ Buffer    ¦ Passed 2    ¦ Valid 2   ¦ Completed 2 ¦ Complete 2 ¦ Error 2 ¦ Ack      ¦ Ready     ¦  E  |
¦        ¦ Overrun 2 ¦             ¦           ¦             ¦            ¦         ¦ Camera 2 ¦ Camera 2  ¦  n  |
+----------------------------------------------------------------------------------------------------------+  g  |
¦ 33     ¦ Rsvd      ¦ Rsvd        ¦ Rsvd      ¦ Rsvd        ¦ Rsvd       ¦ Rsvd    ¦ Rsvd     ¦ Set       ¦  i  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ UserData  ¦  n  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ Ack 2     ¦  e  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 34-35  ¦                                  Acquisition ID 2                                               ¦  2  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 36-37  ¦                                  Inspected Image ID 2                                           ¦     |
+----------------------------------------------------------------------------------------------------------+     |
¦ 38-39  ¦                                  Inspection Result Code 2                                       ¦     |
+----------------------------------------------------------------------------------------------------------+  ---
¦ 40     ¦ Results   ¦ Inspection  ¦ Results   ¦ Inspection  ¦ Exposure   ¦ Acq     ¦ Trigger  ¦ Trigger   ¦     |
¦        ¦ Buffer    ¦ Passed 3    ¦ Valid 3   ¦ Completed 3 ¦ Complete 3 ¦ Error 3 ¦ Ack      ¦ Ready     ¦  E  |
¦        ¦ Overrun 3 ¦             ¦           ¦             ¦            ¦         ¦ Camera 3 ¦ Camera 3  ¦  n  |
+----------------------------------------------------------------------------------------------------------+  g  |
¦ 41     ¦ Rsvd      ¦ Rsvd        ¦ Rsvd      ¦ Rsvd        ¦ Rsvd       ¦ Rsvd    ¦ Rsvd     ¦ Set       ¦  i  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ UserData  ¦  n  |
¦        ¦           ¦             ¦           ¦             ¦            ¦         ¦          ¦ Ack 3     ¦  e  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 42-43  ¦                                  Acquisition ID 3                                               ¦  3  |
+----------------------------------------------------------------------------------------------------------+     |
¦ 44-45  ¦                                  Inspected Image ID 3                                           ¦     |
+----------------------------------------------------------------------------------------------------------+     |
¦ 46-47  ¦                                  Inspection Result Code 3                                       ¦     |
+----------------------------------------------------------------------------------------------------------+  ---
¦ 48-??? ¦                                  Inspection Results                                             ¦     |
¦        ¦                                                                                                 ¦  R  |
¦        ¦                                                                                                 ¦  e  |
¦        ¦                                                                                                 ¦  s  |
¦        ¦                                                                                                 ¦  u  |
¦        ¦                                                                                                 ¦  l  |
¦        ¦                                                                                                 ¦  t  |
¦        ¦                                                                                                 ¦  s  |
¦        ¦                                                                                                 ¦     |
+----------------------------------------------------------------------------------------------------------+ ----
NDM Control Signal Table (Controls signals are signals sent from the PLC to the Vision System)
+--------------------------------------------------------------------------------------------------+
¦        ¦ Bit 7   ¦ Bit 6  ¦ Bit 5    ¦ Bit 4     ¦ Bit 3  ¦ Bit 2       ¦ Bit 1       ¦ Bit 0    ¦
+--------------------------------------------------------------------------------------------------+  ---
¦ 0      ¦ Set     ¦ Clear  ¦ Reserved ¦ Initiate  ¦  Rsvd  ¦ Rsvd        ¦ Buffer      ¦ Trigger  ¦     |
¦        ¦ Offline ¦ Error  ¦          ¦ Job       ¦        ¦             ¦ Results     ¦ Enable   ¦  S  |
¦        ¦         ¦        ¦          ¦ Load      ¦        ¦             ¦ Enable      ¦          ¦  y  |
+--------------------------------------------------------------------------------------------------+  s  |
¦ 1      ¦                          Reserved                                                       ¦  t  |
+--------------------------------------------------------------------------------------------------+  e  |
¦ 2-3    ¦                          Job Load ID                                                    ¦  m  |
+--------------------------------------------------------------------------------------------------+     |
¦ 4-7    ¦                          SoftEvent 0-31                                                 ¦  C  |
+--------------------------------------------------------------------------------------------------+  o  |
¦ 8-9    ¦                          Reserved                                                       ¦  n  |
+--------------------------------------------------------------------------------------------------+  t  |
¦ 10-11  ¦                          Reserved                                                       ¦  r  |
+--------------------------------------------------------------------------------------------------+  o  |
¦ 12-13  ¦                          Reserved                                                       ¦  l  |
+--------------------------------------------------------------------------------------------------+     |
¦ 14-15  ¦                          Reserved                                                       ¦     |
+--------------------------------------------------------------------------------------------------+  ---
¦ 16     ¦ Rsvd    ¦ Rsvd   ¦ Rsvd     ¦ Rsvd      ¦ Set    ¦ Clear       ¦ Inspection  ¦ Trigger  ¦     |
¦        ¦         ¦        ¦          ¦           ¦ User   ¦ Exposure    ¦ Results     ¦ Camera 0 ¦  E  |
¦        ¦         ¦        ¦          ¦           ¦ Data 0 ¦ Complete 0  ¦ Ack 0       ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  g  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  i  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  e  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  0  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
+--------------------------------------------------------------------------------------------------+  ---
¦ 17     ¦ Rsvd    ¦ Rsvd   ¦ Rsvd     ¦ Rsvd      ¦ Set    ¦ Clear       ¦ Inspection  ¦ Trigger  ¦     |
¦        ¦         ¦        ¦          ¦           ¦ User   ¦ Exposure    ¦ Results     ¦ Camera 1 ¦  E  |
¦        ¦         ¦        ¦          ¦           ¦ Data 1 ¦ Complete 1  ¦ Ack 1       ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  g  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  i  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  e  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  l  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
+--------------------------------------------------------------------------------------------------+  ---
¦ 18     ¦ Rsvd    ¦ Rsvd   ¦ Rsvd     ¦ Rsvd      ¦ Set    ¦ Clear       ¦ Inspection  ¦ Trigger  ¦     |
¦        ¦         ¦        ¦          ¦           ¦ User   ¦ Exposure    ¦ Results     ¦ Camera 2 ¦  E  |
¦        ¦         ¦        ¦          ¦           ¦ Data 2 ¦ Complete 2  ¦ Ack 2       ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  g  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  i  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  e  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  2  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
+--------------------------------------------------------------------------------------------------+  ---
¦ 19     ¦ Rsvd    ¦ Rsvd   ¦ Rsvd     ¦ Rsvd      ¦ Set    ¦ Clear       ¦ Inspection  ¦ Trigger  ¦     |
¦        ¦         ¦        ¦          ¦           ¦ User   ¦ Exposure    ¦ Results     ¦ Camera 3 ¦  E  |
¦        ¦         ¦        ¦          ¦           ¦ Data 3 ¦ Complete 3  ¦ Ack 3       ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  g  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  i  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  n  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  e  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦  3  |
¦        ¦         ¦        ¦          ¦           ¦        ¦             ¦             ¦          ¦     |
+--------------------------------------------------------------------------------------------------+  ---
¦ 20-??? ¦                          User Data                                                      ¦     |
¦        ¦                                                                                         ¦  U  |
¦        ¦                                                                                         ¦  s  |
¦        ¦                                                                                         ¦  e  |
¦        ¦                                                                                         ¦  r  |
¦        ¦                                                                                         ¦     |
¦        ¦                                                                                         ¦  D  |
¦        ¦                                                                                         ¦  a  |
¦        ¦                                                                                         ¦  t  |
¦        ¦                                                                                         ¦  a  |
¦        ¦                                                                                         ¦     |
+--------------------------------------------------------------------------------------------------+ ----
See Also