}
//2. Open the connection
con = new TCPMasterConnection(addr);
con.setPort(port);
con.connect();
if (Modbus.debug) System.out.println("Connected to " + addr.toString() + ":" + con.getPort());
//3. Prepare the requests
ai_req = new ReadInputRegistersRequest(ai_ref, 1);
ao_req = new WriteSingleRegisterRequest();