添加小板程序版本读取

This commit is contained in:
ranchuan
2024-03-12 17:04:07 +08:00
parent 5aa013e168
commit 5bd29dd25d
11 changed files with 164 additions and 26 deletions

View File

@@ -479,8 +479,8 @@ if __name__ == "__main__":
# u.cmd=0x41
# data=bytearray([1,100,0x00,2,0,0x00,3,0,0x00,4,0,0x00,5,0,0x00,6,0,0x00,7,0,0x00,8,0,0x00,9,0,0x00,10,0,0x00,11,0,0x00,12,0,0x00,13,0,0x00,14,0,0x00,15,0,0x00,16,0,0x00,17,0,0x00,18,0,0x00,19,0,0x00,20,0,0x00])
# 测量电阻
u.cmd=0x42
data=bytearray([5])
# u.cmd=0x42
# data=bytearray([5])
# 设置硬件版本号
# u.cmd=0x43
# data=bytearray([1,50,0x00,2,51,0x00,3,52,0x00,4,53,0x00,5,54,0x00,6,55,0x00,7,56,0x00,8,57,0x00,9,58,0x00,10,59,0x00,11,60,0x00,12,61,0x00,13,62,0x00,14,63,0x00,15,64,0x00,16,65,0x00,17,66,0x00,18,67,0x00,19,68,0x00,20,69,0x00])
@@ -493,12 +493,15 @@ if __name__ == "__main__":
# u.cmd=0x44
# data=bytearray([5])
# 赋码仪新检测命令
u.cmd=0x10
data=bytearray([0xff,0x03,0,0,0,0])
# u.cmd=0x10
# data=bytearray([0xff,0x03,0,0,0,0])
# 批检仪新检测命令,写入流水号
# u.cmd=0x48
# data=bytearray([2,1,2,3,0, 3,5,6,7,0, 9,8,9,10,0])
u.cmd=0x50
data=bytearray([7])
print(u.encode(data).hex(' '))
# with open("file/EX_Coder_Test_2023-07-6.json","rb") as f:
# json_obj=json.loads(f.read())
@@ -523,3 +526,19 @@ if __name__ == "__main__":
# 直接检测
# 59 6d 04 00 44 00 00 05 d5 6c
# 电机归零
# 59 6d 04 00 50 00 00 01 d1 5f
# 电机下降20000步
# 59 6d 06 00 50 00 00 02 20 4e f4 45
# 电机上升20000步
# 59 6d 06 00 50 00 00 03 20 4e a5 85
# 测量桥丝阻值
# 59 6d 04 00 50 00 00 04 11 5c
# 总线设置20V
# 59 6d 06 00 50 00 00 05 c8 00 8b b0
# 关总线
# 59 6D 43 05 00 50 00 00 00 06 0E 0E
# 检总线电流
# 59 6d 04 00 50 00 00 07 51 5d