|
发表于 2023-6-30 19:57:44
|
显示全部楼层
这样写了也是一点反应都没有
function on_run(screen)
set_notify(1)
select_slave(1)
set_endian(0)
start_read(1,12,0x0005,16)
local dingsu_1=get_uint16(12,0x0005)
local dingsu_2=get_uint16(12,0x0006)
local xiansu_1=get_uint16(12,0x0007)
local xiansu_2=get_uint16(12,0x0008)
stop_read(1)
if dingsu_2 ~= 0 and xiansu_2 ~= 0
then
now_dingsu=(dingsu_1*100000+dingsu_2)/2000
now_xiansu=(xiansu_1*100000+xiansu_2)/2000
set_uint16(1,0x1006,now_dingsu)
set_uint16(1,0x1007,now_xiansu)
end
set_run_cycle(100)
end
|
|