Definition
flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits = DR_STOPBITS_ONE)
Features
A command used for opening the Pseudo Flange Serial communication port.
After calling this function, a minimum delay of 100 milliseconds is required before the flange serial operates normally.
The characteristics of pseudo flange serial communication are different from normal serial communication. Therefore, handshaking communication is recommended. (e.g., modbus RTU) Due to the internal buffer size limit (255bytes) and internal delay, overflow may occur when used in sensors, etc.
(However, it is not supported by the new Flange I/O (M/H Series 2024.03.22 & A/E Series 2024.04.11 or later) and can be set in the Flange I/O tab of the Robot Parameter module.)
Parameters
|
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
|
baudrate |
int |
115200 |
Baud rate 2400, 4800, 9600, 19200, 38400, 57600, 115200, 1000000 etc |
|
bytesize |
int |
8 |
Number of data bits
|
|
parity |
str |
"N" |
Parity checking
|
|
stopbits |
int |
1 |
Number of stop bits
|
Return
|
Value |
Description |
|---|---|
|
0 |
Successful connection |
|
Negative value |
Fail to connection |
Exception
|
Exception |
Description |
|---|---|
|
DR_Error (DR_ERROR_TYPE) |
Parameter data type error occurred |
|
DR_Error (DR_ERROR_VALUE) |
Parameter value is invalid |
|
DR_Error (DR_ERROR_RUNTIME) |
C extension module error occurred |
|
DR_Error (DR_ERROR_STOP) |
Program terminated forcefully |
Example
flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS,parity=DR_PARITY_NONE, stopbits = DR_STOPBITS_ONE)
wait(0.1)