CogIOMCB ClassCognex VisionPro 9.8
This class encapsulates all characteristics of a single instance of the Measurement Computing PCI-DIO24/S digital input/output board.
Inheritance Hierarchy

System Object
  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: 75.1.0.0 (75.1.0.0)
Syntax

[SerializableAttribute]
public sealed class CogIOMCB : CogIODiscreteDevice

The CogIOMCB type exposes the following members.

Constructors

  NameDescription
Public methodCogIOMCB(SerializationInfo, StreamingContext)
Serialization constructor.
Public methodCogIOMCB(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.
Public methodCogIOMCB(CogMCBAPIBase, Int32)
Cognex Internal Use Only
Top
Methods

  NameDescription
Public methodClose
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 .)
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose
Release associated resources and mark this object as disposed.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Finalize. Ensures that this device is closed.
(Overrides Object Finalize .)
Public methodGetCurrentActivityCount
Cognex internal use only
(Inherited from CogIODiscreteDevice.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetLineAlias
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.
Public methodGetLineEnabled
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.
Public methodGetLinePolarity(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.
Public methodGetLinePolarity(Int32, Boolean) (Overrides CogIODiscreteDevice GetLinePolarity(Int32, Boolean).)
Public methodGetLinePulseWidth
Get the pulse width, in milliseconds, for the specified line on this device. This parameter is used by the WriteSyncPulse().
Public methodGetPortDirection
Get the currently configured direction for the specified port.
Public methodGetPortFromLine
Get the identifier of the port that is associated with the specified line on this device.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue
Get the state of the specified line on this device.
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodIsInputAsserted
Manually check whether line is asserted or not.
(Overrides CogIODiscreteDevice IsInputAsserted(Int32).)
Public methodStatic memberIsMCBPresent
Cognex Internal Use Only.
Public methodOpen
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 .)
Public methodResetAllWriteActivityCounter
Cognex internal use only
(Inherited from CogIODiscreteDevice.)
Public methodResumeAndRaiseChangedEvent
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.)
Public methodSetLineAlias
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.
Public methodSetLineEnabled
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.
Public methodSetLinePolarity(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.
Public methodSetLinePolarity(Int32, CogIOLinePolarity, Boolean) (Overrides CogIODiscreteDevice SetLinePolarity(Int32, CogIOLinePolarity, Boolean).)
Public methodSetLinePulseWidth
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.
Public methodSetPortDirection
Set the direction for the specified port. May be set to CogIOMCBPortDirectionConstants.Output, or CogIOMCBPortDirectionConstants.Input, or CogIOMCBPortDirectionConstants.Undefined.
Public methodSetValue
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).)
Public methodSuspendChangedEvent
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.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodWrite(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.
Public methodWrite(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).)
Public methodWriteSyncPulse
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).)
Top
Fields

  NameDescription
Public fieldStatic memberSfLineAlias
Line Alias state flag.
Public fieldStatic memberSfLineEnabled
Line Enabled state flag.
Public fieldStatic memberSfLinePolarity
Line Polarity state flag.
Public fieldStatic memberSfLinePulseWidth
Line Pulse Width state flag.
Public fieldStatic memberSfPortDirection
Port Direction state flag.
Top
Properties

  NameDescription
Public propertyChangedEventSuspended
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.)
Public propertyDeviceIndex
Return the index number of CogIODevice object.
(Inherited from CogIODiscreteDevice.)
Public propertyDeviceName
Return the name that characterizes the instance of CogIODevice object.
(Inherited from CogIODevice.)
Public propertyEnabled (Inherited from CogIODiscreteDevice.)
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyInputDelegate (Inherited from CogIODiscreteDevice.)
Public propertyInputPollingPeriod
Time period between each polling of inputs, in mSec. The default value is 10ms.
Public propertyIsDeviceOpen
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.)
Public propertyMonitorInputs (Overrides CogIODiscreteDevice MonitorInputs.)
Public propertyNumLines
How many lines on this device. Since this will always be 24, this property is provided as a convenience.
Public propertyStateFlags
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.)
Top
Events

  NameDescription
Public eventChanged
This event is raised when one or more parts of the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Public eventIOLineChanged
Cognex internal use only
(Inherited from CogIODiscreteDevice.)
Top
See Also