Files
pitts-touchscreen/3B/archive/root_11.bak/mb.lua

25 lines
274 B
Lua

PLC = require('modbus')
socket = require('socket')
plc = PLC.Modbus("pi_daq",502)
function setup()
if ( plc ) then
print("OK")
end
end
function loop()
if ( plc ) then
plc:sync();
print(plc:getReal(1))
end
socket.sleep(0.5)
end
setup()
while 1 do
loop()
end