|
|
|
|
Functions
MioScript Reference
|
|
Syntax
| RS232.open(COM, baudRate, byteSize, parity, bitStop, abordOnError) |
Parameters
| STRING | COM | COM port (COM1, COM2, COM3...COM255)
| | INT | baudRate | Optional. Baud rate, in bits per second (bps). Default value is 9600.
| | INT | byteSize | Optional. Byte Size. Default value is 8.
| | STRING | parity | Optional. Parity. Can be: NOPARITY (default) EVENPARITY MARKPARITY ODDPARITY SPACEPARITY
| | STRING | bitStop | Optional. ONESTOPBIT (default) ONE5STOPBITS TWOSTOPBITS
| | BOOL | abordOnError | Optional. If set to true, the operation is aborted if an error occurs. Default value is true. |
Return value
Status. true: Success. -1: Serial port not found. -2: Failed to open serial port -3: Failed to set timeout.
|
Description
Opens the specified COM port to establish an RS-232 based communication with a device via a serial port.
The device can be connected to an USB port with a Serial To USB adapter.
It is possible to open any port com from 0 to 255. Only one COM port can be opened, but it is possible to create separate processes to control several COM ports from a single application.
When opened, a COM port cannot be used by another application.
You can close the COM port with {link:RS232:CLOSE}. |
MioScript Sample Code
|
|
|