Ok its works..
my code :
public static void main(String[] args) {
ModbusFactory m = new ModbusFactory();
IpParameters ip = new IpParameters();
ip.setHost("192.168.10.2");
ip.setPort(502);
ModbusMaster mp = m.createUdpMaster(ip);
try {
mp.init();
ModbusRequest req = new WriteRegisterRequest(1,0,1800);
mp.send(req);
ModbusRequest req2 = new ReadHoldingRegistersRequest(1,0,1);
ReadResponse rep = (ReadResponse) mp.send(req2);
System.out.println(rep.getShortData()[0]);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
in my classpath:
axis.jar
bacnet.jar
modbus4j.jar
RTXXcomm.jar
serioUtil.jar
All this library are necessary?
It's not possible to get direct the value short double string? In the good typage?
Thanks four your help and for your job, it's great and its works under windows and linux, before I've tried UDP under linux with jamod and there is serious problems..
It's should be very interessant if the necessary library are of sourceforge.net..
For the novice, a little tutorial should be nice..