CogCommCard ClassCognex VisionPro 9.21
The CogCommCard class represents a single VisionPro Communication Card installed in the system.

VisionPro comm cards are hardware devices designed to handle communication between a VisionPro vision system and the outside world.

VisionPro comm cards utilize dedicated real-time processors to manage I/O. This allows VisionPro vision systems to integrate with demanding real-time control scenarios, and reserves PC hardware resources for image processing and machine vision related tasks.

VisionPro comm cards support one or more communication modules, each communication module supports a different type or style of communication.

For example, a single VisionPro comm card may support discrete (digital) inputs and outputs, and/or Ethernet based Factory Floor Protocols (FFP) such as EtherNet/IP.

This class cannot be constructed. Instances must be retrieved from a CogCommCards collection.

This class provides access to the communication capabilities of a VisionPro Communication Card via its supported module interfaces.

  • Access the factory floor protocol (FFP) capabilities of the comm card via FfpAccess.
  • Access the precision I/O (discrete I/O) capabilities of the comm card via DiscreteIOAccess.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Comm CogCommCard

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

public class CogCommCard : CogObjectBase, 
	IDisposable

The CogCommCard type exposes the following members.

Methods

  NameDescription
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
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 .)
Protected methodGetAttributes
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetClassName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetComponentName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetConverter
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultEvent
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultProperty
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEditor
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetProperties 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetProperties( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetPropertyOwner
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone 
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Properties

  NameDescription
Public propertyDiscreteIOAccess
Gets a discrete I/O access object.

Use the discrete I/O access object to access the discrete I/O and precision I/O features of the comm card.

This property returns null if the hardware does not support discrete I/O.

Public propertyEthernetPortAccess
Gets the Ethernet port access object.

Use the Ethernet port access object to configure the IP settings (IP address, subnet mask, etc...) of the Ethernet ports on the hardware.

The IP settings of the card can also be configured using Comm Card Configurator utility.

This property returns null if the hardware does not support Ethernet port configuration.

Public propertyFfpAccess
Gets a factory floor protocol (FFP) access object.

Use the factory floor protocol access object to access the factory floor protocol features of the comm card.

This property returns null if the hardware does not support factory floor protocols.

Public propertyFirmwareVersion
Gets the version of the firmware running on the hardware.
Public propertyName
Gets the name of the comm card.
Public propertyProductIdentity
Gets the product identity of the hardware.
Public propertySerialNumber
Gets the serial number of the comm card.
Top
Events

  NameDescription
Public eventCardStatus
This event is raised by the Comm Card to report very specific status or error events to the host PC. CardStatus events are typically used to inform the host PC of important "out of band" information that cannot be reported synchronously.
Top
Examples

using Cognex.VisionPro;
using Cognex.VisionPro.Comm;

// Shows simple use of comm card API. 
//  
// Initializes a connection to a Rockwell Control Logix PLC 
// using the EtherNet/IP protocol and the Cognex generic 
// Factory Floor Protocol (FFP) interface known as the  
// Network Data Model (NDM). 
//  
// Signs up for the NDM's "NewUserData" event and prints out the  
// NewUserData as it's received. 
public void Example()
{
  CogCommCards commCardCollection = new CogCommCards();

  Console.WriteLine("Found: {0} comm cards", commCardCollection.Count);

  if (commCardCollection.Count == 0)
    return;

  CogCommCard card = commCardCollection[0];

  Console.WriteLine("Name: {0}", card.Name);
  Console.WriteLine("Serial: {0}", card.SerialNumber);

  Console.WriteLine("Initializing comm card Factory Floor Protocol (FFP)");

  CogFfpAccess ffpAccess = card.FfpAccess;

  if (ffpAccess == null)
    throw new Exception("FFP is not supported.");     

  CogNdm ffpNdm =
    ffpAccess.CreateNetworkDataModel(CogFfpProtocolConstants.EthernetIp);

  ffpNdm.Start();

  Console.WriteLine("Sign up for the NewUserData Event");
  ffpNdm.NewUserData += new CogNdmNewUserDataEventHandler(ffpNdm_NewUserData);    
}

void ffpNdm_NewUserData(object sender, CogNdmNewUserDataEventArgs e)
{
  CogNdm ndm = sender as CogNdm;
  if (ndm != null)
    Console.WriteLine(BitConverter.ToString(ndm.ReadUserData(0, 100)));
}
See Also