Adam 4572 Communication Problem

P

Thread Starter

ParagonIndore

I am having Adam 4572 and trying to communicate with it over modbus/tcp, but unable to do so. each and every time i got timeout exception. Actually nothing is coming from Adam 4572 side.
 
Can you ping it? Can you contact it with the configuration software?

You said you are getting a "timeout exception". Is that an error from your driver, or is that an error being sent back from the 4572?

Do you have something hooked up to the other side of the gateway? It might be trying to pass the message through, but the problem might be on the serial side.
 
F

Fred Loveles

A timeout exception is a gateway error and that usually means that the Modbus serial device on the other side of the gateway is not responding in a timely manner to your requests. You should verify the Modbus slave id for the device and make sure you are sending the correct one from your master.
 
P

ParagonIndore

Below is the sample source code i m using to communicate with Adam 4572 in java. but i get timeout Exception at trans.execute...help me

package ehternettomodbus;

/**
*
* @author nitin
*/
import java.net.*;
import net.wimpi.modbus.*;
import net.wimpi.modbus.msg.*;
import net.wimpi.modbus.io.*;
import net.wimpi.modbus.net.*;
import net.wimpi.modbus.procimg.SimpleRegister;

public class Test {
private static WriteSingleRegisterRequest Wreq;
private static WriteSingleRegisterResponse Wres;

@SuppressWarnings("null")
public static void main (String args[]){

int port = Modbus.DEFAULT_PORT;
int ref = 1;

SimpleRegister sr =null;
sr = new SimpleRegister(32200);

try {
String astr = "192.168.0.89";
InetAddress addr = InetAddress.getByName(astr);
TCPMasterConnection con = new TCPMasterConnection(addr); //the connection
ModbusTCPTransaction trans = null; //the transaction

Wreq = new WriteSingleRegisterRequest(ref,sr);
Wres = new WriteSingleRegisterResponse();

//2. Open the connection
con.setPort(port);
con.connect();
System.out.println("Connected... " + port + " " + ref);

trans = new ModbusTCPTransaction(con);
trans.setRequest(Wreq);

trans.execute();
Wres = (WriteSingleRegisterResponse) trans.getResponse();
System.out.println("The value is: " + Wres.getHexMessage());


con.close();

} catch (Exception ex) {
ex.printStackTrace();
}

System.out.println("Finished");
}

}
 
Top