DOBOT CR5 User Guide 6 Program Language
Issue V3.5.3.1 (2020-05-09) User Guide Copyright © Yuejiang Technology Co., Ltd
96
0: TCP connection is successful
1: Input parameters are incorrect
2: Socket object is not found
3: Timeout setting is incorrect
4: If the robot is set as a client, it indicates that the connection is wrong. If the robot is set
as a server, it indicates that receiving data is wrong
Please refer to Program 6.1 and Program 6.2
Table 6.47 Receive data command
err, Recbuf = TCPRead(socket, timeout, type)
Robot as a client receives data from a server
Robot as a server receives data from a client
socket: socket object
timeout: Receiving timeout. Unit: s. If timeout is 0 or is not set, this command is a block reading.
Namely, the program will not continue to run until receiving data is complete. If not, after
exceeding the timeout, the program will continue to run regardless of whether receiving data is
complete
type: Buffer type. If type is not set, the buffer format of RecBuf is a table. If type is set to string,
the buffer format is a string
err:
0: Receiving data is successful
1: Receiving data is failed
Recbuf: Data buffer
Please refer to Program 6.1 and Program 6.2
Table 6.48 Send data command
TCPWrite(socket, buf, timeout)
The robot as a client sends data to a server
The robot as a server sends data to a client
socket: Socket object
buf: Data sent by the robot
timeout: Timeout. Unit: s. If timeout is 0 or not set, this command is a block reading. Namely,
the program will not continue to run until sending data is complete. If not, after exceeding the
timeout, the program will continue to run regardless of whether sending data is complete