If I remember well there should be some modbus libraries on github