ReadSerial

Reads a text string from the specified serial port into a cell.

Note:
  • The selected serial port must be configured for Text mode, and the In-Sight vision system must be Online. For more information, see Serial Port Settings Dialog.
  • In-Sight Micro 1000 series vision systems only support serial communication when connected to the CIO-MICRO or CIO-MICRO-CC I/O module.
  • There are two options for enabling serial communication for the In-Sight 70xx - 74xx series vision system: using the Breakout cable or using the CIO-MICRO or CIO-MICRO-CC I/O module. When connected to the Breakout cable (and there is no connection to an I/O module), the vision system allows one discrete input line and one discrete output line to be configured as Serial Receive and Serial Transmit, respectively.
  • In-Sight 8000 series vision systems only support serial communication when connected to the CIO-MICRO I/O module.
  • The CIO-WENET Ethernet I/O module does not support serial communication.
  • 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.
  • When using the CIO-1450 I/O Module, if a serial packet is greater than 256 bytes (including termination character), there could be a loss of serial communication between the In-Sight vision system and I/O Module, requiring the power to be cycled on both.

ReadSerial Inputs

Syntax: ReadSerial(Event,Port)

Parameter Description

Event

Specifies the update event on which to read data.

  • This parameter must reference a cell containing an Event function in order to return data. For more information, see Event.
  • The Event's Trigger parameter must specify Serial Port 1 and the Manual parameter must be unchecked.
  • The Event function will appear in the Job Edit toolbar as Event(65,0).

Port

Specifies the serial port to be read.

  • Must be 1 for In-Sight vision systems.
  • Can be 0 or 1 for an In-Sight emulator.

ReadSerial Outputs

Returns

A Serial data structure containing the text string read, or #ERR if either input parameter is invalid.