This class encapsulates all characteristics of a single
instance of the Measurement Computing PCI-DIO24/S digital
input/output board.
Inheritance Hierarchy
System MarshalByRefObject
Cognex.VisionPro.Implementation CogObjectBase
Cognex.VisionPro.Implementation CogSerializableObjectBase
Cognex.VisionPro.Implementation CogSerializableChangedEventBase
Cognex.VisionPro.QuickBuild.IO CogIODevice
Cognex.VisionPro.QuickBuild.IO CogIODiscreteDevice
Cognex.VisionPro.QuickBuild.IO CogIOMCB
Namespace: Cognex.VisionPro.QuickBuild.IO
Assembly: Cognex.VisionPro.QuickBuild.IO (in Cognex.VisionPro.QuickBuild.IO.dll) Version: 73.0.0.0 (73.0.0.0)
Syntax
The CogIOMCB type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogIOMCB(SerializationInfo, StreamingContext) |
Serialization constructor.
| |
| CogIOMCB(String, Int32) |
Create an instance of the CogIOMCB class with the specified
device name and device index. Note that you may only create
at most one instance of this class for a particular device
index.
| |
| CogIOMCB(CogMCBAPIBase, Int32) |
Cognex Internal Use Only
|
Methods
| Name | Description | |
|---|---|---|
| Close |
Close the device. This releases the underlying hardware, making
it available for use later or by another thread. In general,
only call this when you are finished using the device, such as
when your application is about to exit.
(Overrides CogIODevice Close .) | |
| 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.) | |
| Dispose |
Release associated resources and mark this object as disposed.
| |
| Equals | (Inherited from Object.) | |
| Finalize |
Finalize. Ensures that this device is closed.
(Overrides Object Finalize .) | |
| GetCurrentActivityCount |
Cognex internal use only
(Inherited from CogIODiscreteDevice.) | |
| 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.) | |
| GetLineAlias |
Get the alias or name associated with the specified
line on this device. This characteristic is provided
solely as a convenience to the user and has no impact
upon the operation of this device.
| |
| GetLineEnabled |
Is the specified line on this device currently enabled. If
the answer is false, you will be prevented from writing to
or reading from this line.
| |
| GetLinePolarity(Int32) |
Get the polarity for the specified line on this device. With
possible values of CogIOLinePolarity.LowToHigh or
CogIOLinePolarity.HighToLow, this parameter is used
by the Write(), SetValue(), and WriteSyncPulse() methods.
| |
| GetLinePolarity(Int32, Boolean) | (Overrides CogIODiscreteDevice GetLinePolarity(Int32, Boolean).) | |
| GetLinePulseWidth |
Get the pulse width, in milliseconds, for the specified line
on this device. This parameter is used by the WriteSyncPulse().
| |
| GetPortDirection |
Get the currently configured direction for the specified port.
| |
| GetPortFromLine |
Get the identifier of the port that is associated with the
specified line on this device.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| GetValue |
Get the state of the specified line on this device.
| |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| IsInputAsserted |
Manually check whether line is asserted or not.
(Overrides CogIODiscreteDevice IsInputAsserted(Int32).) | |
| IsMCBPresent |
Cognex Internal Use Only.
| |
| Open |
Open the device. Each CogIOMCB object may be associated
with one actual MeasurementComputing PCI-DIO24/S board.
Calling this method causes the underlying hardware connection
to be established and the hardware to be initialized. Upon
successfully calling this method, the IsDeviceOpen property
will be true.
(Overrides CogIODevice Open .) | |
| ResetAllWriteActivityCounter |
Cognex internal use only
(Inherited from CogIODiscreteDevice.) | |
| 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.) | |
| SetLineAlias |
Set the alias or name associated with the specified
line on this device. This characteristic is provided
solely as a convenience to the user and has not impact
upon the operation of this device.
| |
| SetLineEnabled |
Specify whether or not the indicated line on this device
is enabled. If you set this to false for a given line,
you will be prevented from writing to or reading from that
line. If a heartbeat is already running on this line, it
will not be affected, but you will be prevented from
restarting it once you have stopped it.
| |
| SetLinePolarity(Int32, CogIOLinePolarity) |
Set the polarity for the specified line on this device. May
be either CogIOLinePolarity.LowToHigh or
CogIOLinePolarity.HighToLow. This parameter is used by the
Write(), SetValue(), and WriteSyncPulse() methods.
| |
| SetLinePolarity(Int32, CogIOLinePolarity, Boolean) | (Overrides CogIODiscreteDevice SetLinePolarity(Int32, CogIOLinePolarity, Boolean).) | |
| SetLinePulseWidth |
Set the pulse width, in milliseconds, for the specified line
on this device. This parameter is used by the WriteSyncPulse().
If you set this to a new value while a heartbeat is already
running on this line, the heartbeat will not be affected.
If you then stopped and subsequently restarted the heartbeat
on this line, it would reflect this new pulse width value.
| |
| SetPortDirection |
Set the direction for the specified port. May be set to
CogIOMCBPortDirectionConstants.Output, or
CogIOMCBPortDirectionConstants.Input, or
CogIOMCBPortDirectionConstants.Undefined.
| |
| SetValue |
Set the specified line on this device to the specified state.
Note that this method honors the configured polarity of the
specified line. That is, if the specified line is configured
for HighToLow polarity, the value argument will be inverted.
(Overrides CogIODiscreteDevice SetValue(Int32, Boolean).) | |
| 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.) | |
| Write(CogIODiscreteData) |
Set the state of zero or more output lines as described
by the supplied argument. This argument is a data structure
holding a set of line/value pairs. This method steps through
this set of data, setting in turn each specified line to the
specified state.
| |
| Write(CogIOOutputData) |
Set the state of zero or more output lines as described
by the supplied argument. This argument is a data structure
holding a set of line/value pairs. This method steps through
this set of data, setting in turn each specified line to the
specified state.
(Overrides CogIODevice Write(CogIOOutputData).) | |
| WriteSyncPulse |
Write a pulse to the specified line of this device. Use
the pulse duration and polarity values currently associated
with the specified line.
(Overrides CogIODiscreteDevice WriteSyncPulse(Int32).) |
Fields
| Name | Description | |
|---|---|---|
| SfLineAlias | Line Alias state flag. | |
| SfLineEnabled | Line Enabled state flag. | |
| SfLinePolarity | Line Polarity state flag. | |
| SfLinePulseWidth | Line Pulse Width state flag. | |
| SfPortDirection | Port Direction state flag. |
Properties
| 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.) | |
| DeviceIndex |
Return the index number of CogIODevice object.
(Inherited from CogIODiscreteDevice.) | |
| DeviceName |
Return the name that characterizes the instance of CogIODevice object.
(Inherited from CogIODevice.) | |
| Enabled | (Inherited from CogIODiscreteDevice.) | |
| HasChanged | (Inherited from CogSerializableChangedEventBase.) | |
| InputDelegate | (Inherited from CogIODiscreteDevice.) | |
| InputPollingPeriod |
Time period between each polling of inputs, in mSec.
The default value is 10ms.
| |
| IsDeviceOpen |
This property is true upon successfully calling the Open() method.
This property is false upon calling the Close() method. This
property must be true in order to call the Write(), SetValue(),
GetValue(), or WriteSyncPulse() methods.
(Overrides CogIODevice IsDeviceOpen.) | |
| MonitorInputs | (Overrides CogIODiscreteDevice MonitorInputs.) | |
| NumLines |
How many lines on this device. Since this will always be 24,
this property is provided as a convenience.
| |
| 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.) |
Events
| Name | Description | |
|---|---|---|
| Changed |
This event is raised when one or more parts of the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) | |
| IOLineChanged |
Cognex internal use only
(Inherited from CogIODiscreteDevice.) |
See Also