米厂码垛修改
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import socket
|
||||
import binascii
|
||||
import time
|
||||
import Constant
|
||||
|
||||
# 网络继电器的 IP 和端
|
||||
HOST = '192.168.0.18'
|
||||
@ -24,6 +25,8 @@ valve_commands = {
|
||||
|
||||
# 将十六进制字符串转换为字节数据并发送
|
||||
def send_command(command):
|
||||
if Constant.DebugPosition:
|
||||
return True
|
||||
byte_data = binascii.unhexlify(command)
|
||||
# 创建套接字并连接到继电器
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
|
||||
Reference in New Issue
Block a user