A collection containing every
CogCommCard installed in the system.
Upon construction, CogCommCards is automatically initialized to contain one instance for CogCommCard found in the system.
Inheritance Hierarchy
System MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.Implementation CogReadOnlyCollectionNonSerializable CogCommCard
Cognex.VisionPro.Comm CogCommCards
Namespace: Cognex.VisionPro.Comm
Assembly: Cognex.VisionPro.Comm (in Cognex.VisionPro.Comm.dll) Version: 65.1.0.0
Syntax
The CogCommCards type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogCommCards |
Constructs a new instance of the CogCommCards class.
After construction the CogCommCards is populated with a CogCommCard instance
for each comm card found in the system.
|
Methods
| Name | Description | |
|---|---|---|
| Contains |
Determines whether an element is in the collection.
(Inherited from CogReadOnlyCollectionNonSerializable T .) | |
| CopyTo |
Copies the entire Collection to a compatible one-dimensional Array, starting at the specified index of the target array.
(Inherited from CogReadOnlyCollectionNonSerializable T .) | |
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
| Equals | (Inherited from Object.) | |
| Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
| GetAttributes |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetClassName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetComponentName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetConverter |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultEvent |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultProperty |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEditor |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetProperties |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetProperties( Attribute ) |
Causes the list of items to show up in the property grid.
(Inherited from CogReadOnlyCollectionNonSerializable T .) | |
| GetPropertyOwner |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IndexOf |
Searches the collection for the specified object and returns the zero-based index of the first occurrence.
(Inherited from CogReadOnlyCollectionNonSerializable T .) | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
| ToArray |
Calls CopyTo() and returns a new array which contains the members of this collection.
(Inherited from CogReadOnlyCollectionNonSerializable T .) | |
| ToString | (Inherited from Object.) |
Fields
| Name | Description | |
|---|---|---|
| _boardList | ||
| mInnerList | (Inherited from CogReadOnlyCollectionNonSerializable T .) |
Properties
| Name | Description | |
|---|---|---|
| Count |
The number of elements contained in the Collection.
(Inherited from CogReadOnlyCollectionNonSerializable T .) | |
| Item |
Gets the element at the specified index.
(Inherited from CogReadOnlyCollectionNonSerializable T .) |
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