EasyManua.ls Logo

Dobot CR5 - Udp

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
99
else
print("Create failed ".. err)
end
TCPDestroy(socket)
else
print("Create failed ".. err)
end
UDP
Table 6.50 Create UDP network command
Function
err, socket = UDPCreate(isServer, IP, port)
Description
Create a UDP network
Only a single connection is supported
Parameter
isServer: Whether to create a server. 0: Create a client; 1: Create a server
IP: IP address of the server, which is in the same network segment of the client without conflict
port: Server port
When the robot is set as a server, port cannot be set to 502 or 8080. Otherwise, it will be in
conflict with the Modbus default port or the port used in the conveyor tracking application,
causing the creation to fail
Return
err:
0: The UDP network is created successfully
1: The UDP network is created failed
socket: Socket object
Example
Please refer to Program 6.3 and Program 6.4
Table 6.51 Receive data command
Function
err, Recbuf = UDPRead(socket, timeout, type)
Description
The robot as a client receives data from a server
The robot as a server receives data from a client
Parameter
socket: socket object
timeout: Receiving 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 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

Table of Contents

Other manuals for Dobot CR5

Related product manuals