Hi am trying to communicate 1400 with java,, My connection s getting success & while reading N7:0 ,getting the exception follows Exception in thread "main"
Exception in thread "main" java.lang.NullPointerException
at com.emergys.plc.Rockwell.ReadWrite.ControlLogixConnector.receiveData(ControlLogixConnector.java:176)
at com.emergys.plc.Rockwell.ReadWrite.JavaMainController.main(JavaMainController.java:35)
My Code :
System.out.println("Coming inside the main Class....");
EthernetIpBufferUtil messageBuffer = null;
String host = "192.168.1.5";
int portNo = 80;
ControlLogixConnector c = new ControlLogixConnector(host,portNo);
c.connect();
System.out.println("Connection is OK..Reading started..");
String[] tagnames = {"N7:0"};
SimpleLogixCommunicator sComm = new SimpleLogixCommunicator(host, portNo);
ByteBuffer buffer = null;
/*CipMessageRouterRequest.fillBuffer(80, "TEST_INT_READ",(Object)0 , 1, messageBuffer);*/
//CipMessageRouterRequest.getRequestTagName(buffer, "N7:0");
Object[] taglistValue = sComm.read(tagnames);
for ( int i = 0 ; i < taglistValue.length ; i++)
{
System.out.println("Tag value List is : /n " + taglistValue);
}
How to get rid of this error
Thanks & Regards,
Nelliyan.G