Erlang Modebus Client/Server
{ok, Device} = emodbus:connect("localhost", 502).
emodbus:read_coils(Device, Offset, Count).
emodbus:read_hregs(Device, Offset, Count).
%% Coil = 0 | 1
emodbus:write_coil(Device, Offset, Coil).
emodbus:write_hreg(Device, Offset, Value).
emodubs:disconnect(Device).
The MIT License
feng at emqtt.io