EasyManua.ls Logo

Dobot CR5 - Page 101

Dobot CR5
111 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DOBOT CR5 User Guide 6 Program Language
Issue V3.5.3.1 (2020-05-09) User Guide Copyright © Yuejiang Technology Co., Ltd
96
Return
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
Example
Please refer to Program 6.1 and Program 6.2
Table 6.47 Receive data command
Function
err, Recbuf = TCPRead(socket, timeout, type)
Description
Robot as a client receives data from a server
Robot as a server receives data from a client
Parameter
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
Return
err:
0: Receiving data is successful
1: Receiving data is failed
Recbuf: Data buffer
Example
Please refer to Program 6.1 and Program 6.2
Table 6.48 Send data command
Function
TCPWrite(socket, buf, timeout)
Description
The robot as a client sends data to a server
The robot as a server sends data to a client
Parameter
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

Table of Contents

Other manuals for Dobot CR5

Related product manuals