System MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.Implementation CogSerializableObjectBase
Cognex.VisionPro.Implementation CogSerializableChangedEventBase
Cognex.VisionPro.Comm.Implementation.Internal CogPrioEventConfigObjectBase
Cognex.VisionPro.Comm CogPrio
Namespace: Cognex.VisionPro.Comm
Assembly: Cognex.VisionPro.Comm (in Cognex.VisionPro.Comm.dll) Version: 65.1.0.0
The CogPrio type exposes the following members.
| Name | Description | |
|---|---|---|
| CreateDefaultEvents |
Create and return set of default precision i/o events for this hardware.
Adds an "InputChanged_" event for each input line. The event for input line 0 is named "InputChanged_0" and so on... The input events are _CAUSED_ by any signal transition on the dedicated input line. The input events are not configured with a _RESPONSE_. Adds an "PulseOutput_" event for each output line. The event for output line 0 is named "PulseOutput_0" and so on... The output events _RESPOND_ by pulsing the the dedicated output line high for 10.0ms. The output events are not configured with a _CAUSE_ and only occcur as a result direct user scheduling. This method creates and returns a collection of events. Note that you need to assign the returned collection of default events to the Comm Card Prio object (i.e. mPrio.Events = mPrio.CreateDefaultEvents()) if you wish to actually configure and use these events on the hardware. | |
| 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.) | |
| DisableEvents |
Disables all configured events from firing.
| |
| Dispose | ||
| EnableEvents |
Enables the configured events.
| |
| Equals | (Inherited from Object.) | |
| GetBanks |
Returns an array of the supported I/O banks of the current hardware.
| |
| GetBankType |
Returns the type (input, output, etc...) of a given I/O bank
| |
| 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.) | |
| GetNumLines |
Returns the number of I/O lines the hardware supports in the given bank.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| IsBankSupported |
Returns true if the hardware supports the given I/O bank.
| |
| IsInputBank |
Returns true if the bank is an input bank.
| |
| IsLineSupported |
Returns true if the hardware supports the given I/O bank.
| |
| IsOutputBank |
Returns true if the bank is an output bank.
| |
| ReadState |
Get the current state of the I/O interface.
| |
| ResumeAndRaiseChangedEvent |
Re-enables raising of the Changed event after SuspendChangedEvent
has been called, and raises the Changed event if the
ChangedEventSuspended count is reduced to zero and any changes were
made while events were suspended. Must be called once for each call to
SuspendChangedEvent.
(Inherited from CogSerializableChangedEventBase.) | |
| SetEncoderCount |
Set the encoder count.
Note that current hardware platforms only report 32-bits of encoder data. This means that, depending on the hardware, the encoder may rollover (go back to 0) when the encoder count reaches 4294967295, (0xFFFFFFFF). On platforms like this only the lower 32 bits of the encoderCount argument are used when calling SetEncoderCount()... So don't try to set the encoder count to a negative number or a number greater than 4294967295. | |
| SetOutput |
Set an output line.
| |
| SetOutputs(CogPrioBankConstants, Int64) |
Set multiple output lines at the same time.
| |
| SetOutputs(CogPrioBankConstants, Int64, Int64) |
Set multiple output lines at the same time.
| |
| SetValid |
Cognex Internal Use Only
(Inherited from CogPrioEventConfigObjectBase.) | |
| SetValid(Boolean, String ) |
Cognex Internal Use Only
(Inherited from CogPrioEventConfigObjectBase.) | |
| SuspendChangedEvent |
Temporarily suspends the raising of the Changed event. May be called
more than once, and a corresponding call to ResumeAndRaiseChangedEvent
must be made for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventBase.) | |
| ToString | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
| SfDebounceDuration |
This bit will be set in the EventArgs of a Changed event
every time the value returned by DebounceDuration
may have changed.
| |
| SfEvents |
This bit will be set in the EventArgs of a Changed event
every time the value returned by Events may have changed.
|
| Name | Description | |
|---|---|---|
| ChangedEventSuspended |
If nonzero, indicates that the raising of the Changed event has been
suspended. This value is incremented when SuspendChangedEvent is called
and decremented when ResumeAndRaiseChangedEvent is called.
(Inherited from CogSerializableChangedEventBase.) | |
| ClockFrequency |
Get the frequency of the clock. Use this value
to convert clock ticks to wall clock time.
| |
| DebounceDuration |
Gets or sets the debounce duration in milliseconds for all input lines.
| |
| Events |
A collection of
CogPrioEvent.
Add and configure events within this collection to interact with the
precision I/O event system.
| |
| HasChanged | (Inherited from CogSerializableChangedEventBase.) | |
| StateFlags |
Returns the complete set of state flags supported on this object. The
flags may be indexed by name as shown in the following C# code snippet:
if (changedObject.StateFlags["Color"] & eventArgs.StateFlags) { ... }
(Inherited from CogSerializableChangedEventBase.) | |
| Valid |
Indicates whether the configuration of this object is
valid/invalid for the current hardware.
(Inherited from CogPrioEventConfigObjectBase.)The valid/invalid state is automatically updated when this object is part of a CogPrio.Events collection. Objects marked Invalid should be reconfigured to be valid. Otherwise the CogPrio event system will not function. Use the validationErrorMsg to understand how to reconfigure the object to be valid. | |
| ValidationErrorMsg |
Returns a collection of validation error messages that describe
issues with the CogPrio.Events configuration.
(Inherited from CogPrioEventConfigObjectBase.)The valid/invalid state is automatically updated when this object is part of a CogPrio.Events collection. Objects marked Invalid should be reconfigured to be valid. Otherwise the CogPrio event system will not function. Use the validation error msg to understand how to reconfigure the object to be valid. |
| Name | Description | |
|---|---|---|
| Changed |
This event is raised when one or more parts of the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) |
Precision I/O supports getting and setting the state of the Comm Card's Discrete I/O lines.
Precision I/O also supports configuration of an event system that runs on the Comm Card's real-time processor.
The precision I/O event system allows the Comm Card to receive inputs and automatically react to them without involving the host PC.
This enables accurate configuration and reporting of I/O events and avoids typical host PC latency issues.
- Use SetOutput(CogPrioBankConstants, Int32, CogPrioOutputLineValueConstants) to manually set an I/O line high or low.
- Use ReadState to get the current state the I/O lines.
- Construct instances of CogPrioEvent and add them to the Events collection to configure a set of named events that correspond to different actions of interest that occur on the I/O card.
- Use CausesLine to configure which I/O line transitions cause a precision I/O event to occur.
- Use CausesNdm to configure which NDM signals of the factory floor protocol cause a precision I/O event to occur.
- Use ResponsesLine to configure an automatic I/O line response to a precision I/O event.
- Use Schedule(CogPrioEventScheduleTypeConstants, Double, CogPrioState) to manually schedule a configured precision I/O event to occur at an precise instant.
- Use HostNotification to receive notifications whenever a configured event occurs.
Hardware platforms and supported I/O lines:
| Cognex Communication Card 24C | |
|---|---|
| InputBank0, Line0-Line7 | 8 general purpose inputs numbered 0-7 |
| OutputBank0, Line0-Line15 | 16 general purpose outputs numbered 0-15 |
| Cognex Communication Card 24A (Cognex Vision Controller) | |
|---|---|
| InputBank0, Line0-Line7 | 8 general purpose inputs numbered 0-7 |
| OutputBank0, Line0-Line15 | 16 general purpose outputs numbered 0-15 |
| DS1000OutputBank0, Line0 | Camera 0 Enable (Not For Application Use) |
| DS1000OutputBank0, Line1 | Camera 1 Enable (Not For Application Use) |
| DS1000OutputBank0, Line2 | Camera 0 Trigger |
| DS1000OutputBank0, Line3 | Camera 1 Trigger |
| DS1000OutputBank0, Line4 | Camera 0 Control (Not For Application Use) |
| DS1000OutputBank0, Line5 | Camera 1 Control (Not For Application Use) |
| DS1000OutputBank0, Line6 | Camera 0 Power (Not For Application Use) |
| DS1000OutputBank0, Line7 | Camera 1 Power (Not For Application Use) |
// This code shows simple use of // Comm Card API. This sample: // // 1. Initializes comm card's i/o interface. // 2. Reads input line 0. // 3. Signs up for host notification when input line 0 toggles. // 4. Sets an output line 0 high. [Test] public void Example2() { 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); CogDiscreteIOAccess discreteIOAccess = card.DiscreteIOAccess; if (discreteIOAccess == null) throw new Exception("discrete IO is not supported."); // Create the prio interface CogPrio prio = discreteIOAccess.CreatePrecisionIO(); // Read input 0 bool isInputLine0High = mPrio.ReadState()[CogPrioBankConstants.InputBank0, 0]; Console.WriteLine("Input line 0 is " + (isInputLine0High ? "high" : "low")); // Create an event that occurs when Input 0 changes prio.Events.Add( new CogPrioEvent() { Name = "InputChanged_0", CausesLine = new CogPrioEventCauseLineCollection() { new CogPrioEventCauseLine() { LineBank = CogPrioBankConstants.InputBank0, LineNumber = 0, LineTransition = CogPrioLineTransitionConstants.Any }}}); // Sign up for host notification when on the event prio.Events["InputChanged_0"].HostNotification += new CogPrioEventHandler(InputChanged_0_HostNotification); // Always ensure the events collection is valid. if(!prio.Valid) { Console.WrtieLine(prio.ValidationErrorMsg[0]); } // Set output 0 high prio.SetOutput(CogPrioBankConstants.OutputBank0, // i/o bank 0, // line number CogPrioOutputLineValueConstants.SetHigh); // line value to set } void InputChanged_0_HostNotification(object sender, CogPrioEventArgs e) { Console.WriteLine("rcvd host notification for InputChanged_0 event"); }