SetSerialPort

Configures settings that are found in the Serial Port Settings dialog. For more information, see Serial Port Settings Dialog.

Note:
  • The In-Sight system must be Offline.
  • DeviceNet is only available on In-Sight vision systems using In-Sight firmware 4.x.x, and is not available on In-Sight vision systems running In-Sight firmware 5.1.0 and later. For a complete list of models and supported firmware versions, see Firmware Versions .
  • 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. For more information, see Enable Serial Communication: In-Sight 70xx - 74xx.
  • 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.
  • Use the Store Settings (TS) native mode command to save changes to the proc.set file. If not saved to the proc.set file, the changes will be lost after power-cycling the In-Sight vision system. For more information, see Store Settings.

SetSerialPort Inputs

Syntax: EV SetSerialPort(SerialPortNum,Mode,BaudRate,DataBits,StopBits,Parity,Handshake,InputPacketSize,OutputPacketSize,
InputTerminator,OutputTerminator,FixedInputMode,FixedInputLength,DeviceNetTrigger)

Parameter Description
SerialPortNum

1

 

Mode
  • 1 = Unused (Closed)
  • 6 = Text
  • 7 = Native*
  • 8 = DeviceNet
  • 9 = Motoman
  • 10 = Kuka
BaudRate
  • 1200
  • 2400
  • 4800
  • 9600
  • 19200
  • 38400
  • 57600
  • 115200*
DataBits
  • 4 = 7 Data Bits
  • 8 = 8 Data Bits*
StopBits
  • 1 = 1 Stop Bit*
  • 4 = 2 Stop Bits
Parity
  • 256 = None*
  • 512 = Odd
  • 1024 = Even
Handshake
  • 0 = None*
  • 1 = Hardware
  • 2 = Xon/Xoff
InputPacketSize (DeviceNet Only)

1 to 255, 1*

OutputPacketSize (DeviceNet Only)

1 to 255, 1*

InputTerminator (Text and Native Only)

1 to 255, 13*

OutputTerminator (Text and Native Only)
  • -1 = CRLF
  • 0 = No terminator
  • 1 to 255, 13*
FixedInputMode (Text and Native Only)
  • 0 = Disabled*
  • 1 = Enabled
FixedInputLength (Text and Native Only)

1 to 255, 1*

DeviceNetTrigger (DeviceNet Only)
  • 0 = Disabled
  • 1 = Enabled*
* denotes default value

SetSerialPort Outputs

Returns a status code, followed by the number of characters (in bytes) for the results, then the results in XML format. The status codes are:

Status Codes Description
1 The command was executed successfully.
0 Unrecognized command.
-2 The command could not be executed.
-6 User does not have Full Access to execute the command. For more information, see User Access Settings Dialog.

SetSerialPort Example

To configure the following settings:

  • SerialPortNum: 1
  • Mode: 7
  • BaudRate: 115200
  • DataBits: 8
  • StopBits: 1
  • Parity: 256
  • Handshake: 0
  • InputPacketSize: 0
  • OutputPacketSize: 0
  • InputTerminator: 13
  • OutputTerminator: 13
  • FixedInputMode: 0
  • FixedInputLength: 0
  • DeviceNetTrigger: 1

Issue the following command: EV SetSerialPort(1,7,115200,8,1,256,0,0,0,13,13,0,0,1)

The In-Sight vision system responds with a status code (1), followed by the number of characters, in bytes (18). Finally, the results are returned in XML format.