Definition
flange_serial_write(tx_data, port=1)
Features
This function records the data (data) to a flange serial port.
After invoking this function, you must wait at least 200 milliseconds before invoking it again.
In DRL, use the wait(0.2) command on the following line to enforce the delay.
Parameters
|
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
|
tx_data |
byte |
- |
Data to be transmitted (max 32byte)
|
|
port
|
int |
1 |
Port number to write X1 Port: 1 X2 Port: 2 (Not available for A Series) |
Return
|
Value |
Description |
|---|---|
|
0 |
Success |
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
# 2F-85 Gripper Examples
# Activation Request(clear Act)
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x00\x00\x00\x00\x00\x00"))
wait(0.2)
# Activation Request(set Act)
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x01\x00\x00\x00\x00\x00"))
wait(0.2)