Breadcrumbs

flange_serial_open()

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

  • DR_FIVEBITS : 5

  • DR_SIXBITS : 6

  • DR_SEVENBITS : 7

  • DR_EIGHTBITS : 8

parity

str

"N"

Parity checking

  • DR_PARITY_NONE: "N"

  • DR_PARITY_EVEN: "E"

  • DR_PARITY_ODD: "O"

stopbits

int

1

Number of stop bits

  • DR_STOPBITS_ONE =1

  • DR_STOPBITS_TWO = 2

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

Python
flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS,parity=DR_PARITY_NONE, stopbits = DR_STOPBITS_ONE)
wait(0.1)