Instances of CogFfpAccess class are held by the
CogCommCard comm card class.
CogFfpAccess is used to factory/initialize instances of the factory floor protocols running on the comm card by calling CreateNetworkDataModel(CogFfpProtocolConstants).
The Network Data Model (NDM) is the way Cognex VisionPro Vision Systems interact with a PLC.
Inheritance Hierarchy
Cognex.VisionPro.Comm CogFfpAccess
Namespace: Cognex.VisionPro.Comm
Assembly: Cognex.VisionPro.Comm (in Cognex.VisionPro.Comm.dll) Version: 75.1.0.0
Syntax
The CogFfpAccess type exposes the following members.
Methods
| Name | Description | |
|---|---|---|
| CreateNetworkDataModel |
Creates a network data model (NDM) interface on the comm card.
The network data model is used to send and receive
messages between the vision system and a remote device
(usually a PLC).
| |
| CreateNetworkDataModelEip |
Creates a network data model interface on the comm card
using the EtherNet/IP protocol.
| |
| CreateNetworkDataModelProfinet |
Creates a network data model interface on the comm card
using the PROFINET protocol.
| |
| CreateNetworkDataModelSlmp |
Creates a network data model interface on the comm card
using the SLMP protocol.
| |
| Dispose | ||
| Dispose(Boolean) | ||
| Equals | (Inherited from Object.) | |
| Finalize | (Overrides Object Finalize .) | |
| GetActiveNetworkDataModel |
Returns a reference to the currently active Network Data Model (NDM)
object held by the Comm Card or null if no currently active NDM exists.
An active Network Data Model will only exist if one of the CreateNetworkDataModel(CogFfpProtocolConstants) methods has been called previously. | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ToString | (Inherited from Object.) |
Properties
| Name | Description | |
|---|---|---|
| AvailableProtocols |
Returns a list of the available protocols.
|
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