- Use AddEvent(Int32, CogPrioBankConstants, Int32, CogPrioLineTransitionConstants) to configure a set of events that correspond to different actions occurring on the hardware.
- Use ConfigureOutputLineResponse(CogPrioBankConstants, Int32, Int32, CogPrioOutputLineValueConstants, CogPrioDelayTypeConstants, Double, Double) to set up automatic I/O responses that automatically occur in reaction an event.
- Use ScheduleIOEvent(Int32, CogPrioImplEventScheduleTypeConstants, Int64, Int32, Int32 , CogPrioState ) to manually schedule a configured event to occur at an exact time stamp or encoder count.
- Use HostNotification to receive notifications whenever a configured event occurs.
Cognex.VisionPro.Comm.Implementation.Internal CogPrioImpl
Namespace: Cognex.VisionPro.Comm.Implementation.Internal
Assembly: Cognex.VisionPro.Comm (in Cognex.VisionPro.Comm.dll) Version: 87.0.0.0
The CogPrioImpl type exposes the following members.
| Name | Description | |
|---|---|---|
| AddEvent |
Registers a precision I/O event ID number to monitor an input
or output line for a particular transition.
The registered I/O event is raised whenever the configured I/O line transition occurs. Once an event is added it can be used as an argument to ConfigureOutputLineResponse(CogPrioBankConstants, Int32, Int32, CogPrioOutputLineValueConstants, CogPrioDelayTypeConstants, Double, Double) to set up automatic I/O responses that automatically occur in reaction the event firing. The user can also manually schedule a configured event to occur at an exact time stamp or encoder count using ScheduleIOEvent(Int32, CogPrioImplEventScheduleTypeConstants, Int64, Int32, Int32 , CogPrioState ). Additionally the user can receive notifications whenever a configured event occurs using HostNotification. | |
| CancelScheduledEvent |
Cancel a scheduled event using the instance tag returned from
ScheduleIOEvent(Int32, CogPrioImplEventScheduleTypeConstants, Int64, Int32, Int32 , CogPrioState ) | |
| ClearOutputLineResponse |
Clears all usages of the given output line from the event
system.
| |
| ConfigureOutputLineResponse |
Configures an output line to react to a registered I/O event in
a specific way.
| |
| DisableEvents |
Disables all the configured events from firing.
Events can be disabled during configuration, and
re-enabled when configuration is complete.
| |
| DisableHostNotificationForIOEvent |
Disables the HostNotification
.NET Event for the configured precision I/O comm card event.
The host PC will _NOT_ be interrupted/notified when the precision I/O
event occurs on the comm card.
| |
| Dispose | ||
| Dispose(Boolean) | ||
| EnableEvents |
Enables the configured events.
| |
| EnableHostNotificationForIOEvent |
Enables the HostNotification
.NET Event for the configured precision I/O comm card event.
The host PC will be interrupted/notified when the precision I/O
event occurs on the comm card.
| |
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
| Finalize | (Overrides Object Finalize .) | |
| GetClockFrequency |
Gets the clock frequency. Use this value to convert
clock ticks to wall clock time.
| |
| 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.) | |
| ReadState |
Gets the current state of the precision I/O hardware.
| |
| RemoveEvent |
Removes the previously configured event
for a particular I/O line transition.
| |
| RemoveEventFromAll |
Completely removes an event from the set of
configured precision I/O events.
| |
| Reset |
Resets the entire precision I/O system to the default state.
| |
| ScheduleIOEvent |
Manually schedules an I/O event to occur.
| |
| SetDebounceDuration |
Sets the debounce duration for all input lines to the specified number of milliseconds.
| |
| SetEncoderCount |
Sets the encoder count to the specified value.
| |
| SetOutput |
Sets an output line without having to schedule an event.
| |
| ToString | Returns a String that represents the current Object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
| HostNotification |
The HostNotification event is raised to signal the PC that a
precision I/O event has occurred.
NOTE: HostNotification events must be explicitly enabled for each event number by calling EnableHostNotificationForIOEvent(Int32). |
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))); }