SetSerialPort
Configures settings that are found in the Serial Port Settings dialog. For more information, see Serial Port Settings Dialog.
- 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.
- 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 |
|
BaudRate |
|
DataBits |
|
StopBits |
|
Parity |
|
Handshake |
|
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) |
|
FixedInputMode (Text and Native Only) |
|
FixedInputLength (Text and Native Only) |
1 to 255, 1* |
DeviceNetTrigger (DeviceNet Only) |
|
* 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. |
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.