ReadDiscrete

Reads a range of bits from a discrete input channel.

Note:
  • This function is enabled only when the vision system is Online.
  • In job deployment environments where In-Sight Explorer or the VisionView application are monitoring inspections, if the job depends on a Soft Event (e.g., configured as a Timer function) to trigger a spreadsheet event, it may cause the inspection of an image to be delayed if it is triggered shortly before the acquisition cycle completes. If the job file is large (i.e., it contains many Vision Tools, such as Pattern Match, Flaw Detection or InspectEdge tools, in addition to other job logic), the update required by In-Sight Explorer or VisionView may prevent an image from being inspected until the display update is queued. For applications that require exact timing (e.g., measured in the 10s of milliseconds), this update might delay the determination of pass/fail results and the transmission of results to the next station (e.g., a PLC or motion controller) in the inspection process. To avoid delayed inspections in these application environments, Cognex recommends Soft Events not be used.

ReadDiscreteInputs

Syntax: ReadDiscrete(Event,Start Bit,Number of Bits)

Parameter Description

Event

Specifies the update event on which to read. This parameter must be a reference to one of the following:

  • The Image data structure in cell A0, containing the AcquireImage function. For more information, see AcquireImage.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.

Start Bit

Specifies the first bit of the set to beread.

  • In-Sight 5000 series and Micro series: 0 to 9; default = 0
  • In-Sight 70xx - 74xx series: 0 to 13; default = 0
  • In-Sight 76xx - 79xx series: 0 to 15; default = 0
  • In-Sight 8000 series: 0 to 15; default = 0
  • In-Sight 9902L: 0 to 15; default = 0
  • In-Sight 9912: 0 to 15; default = 0

Number of Bits

Specifies the number of bits in the set tobe read.

  • In-Sight 5000 series and Micro series: 1 to 10; default = 10
  • In-Sight 70xx - 74xx series: 1 to 14; default = 10
  • In-Sight 76xx - 79xx series: 1 to 16; default = 10
  • In-Sight 8000 series: 1 to 16; default = 10
  • In-Sight 9902L: 1 to 16; default = 10
  • In-Sight 9912: 1 to 16; default = 10

ReadDiscreteOutputs

Returns The positive integer value read, or #ERRfor any invalid input parameter.