|
楼主 |
发表于 2024-2-23 09:47:08
|
显示全部楼层
我调用这个函数:
print("mb_read_reg_03 typ:",type(mb_read_reg_03(03,01,1))) print("mb_read_reg_03:",mb_read_reg_03(03,01,1)),
打印出来的结果是:
09:38:56.271 TXD 03 03 00 01 00 01 D4 28
09:38:56.319 RXD 03 03 02 00 00 C1 84
09:38:56.319 DBG mb_read_reg_03 typ: table
09:38:56.319 TXD 03 03 00 01 00 01 D4 28
09:38:56.361 RXD 03 03 02 00 00 C1 84
09:38:56.361 DBG mb_read_reg_03: table: 16C48518
接着我把表中内容打印出来:
buff=mb_read_reg_03(03,01,1)
print("BUFF:",buff[0],buff[1],buff[2],buff[3],buff[4],buff[5],buff[6])
结果是:
09:43:55.854 TXD 03 03 00 01 00 01 D4 28
09:43:55.895 RXD 03 03 02 00 00 C1 84
09:43:55.895 DBG BUFF: 0 nil nil nil nil nil nil
为什么我表中的数据是nil呢?是我哪里操作错误了吗?请大佬帮我康康 |
|