ModbusReq. GetInstance (). SetParam (new ModbusParam ()
SetHost (IP. GetText (). The toString ())
SetPort (Integer. ParseInt (port. The getText (), toString ()))
SetEncapsulated (false)
SetKeepAlive (true)
SetTimeout (5000)
. SetRetries (3))
Init (new OnRequestBack
@ Override
Public void onSuccess (String s) {
Toast. MakeText (MainActivity. This, "Success", Toast. LENGTH_SHORT), show ();
}
@ Override
Public void onFailed (String MSG) {
Toast. MakeText (MainActivity. This "Failed:" + MSG, Toast. LENGTH_SHORT), show ();
}
});
}
Trying to make an Android modbusTCP communications, call "modbus4Android - 1.2. The jar" is the jar package, is "the modbus master is not inited successfully", for help to analyse the great god, what is going wrong
CodePudding user response:
Didn't answer. I have been settled by other defensive android link PLC problem, end this post. The APP links:Link: https://pan.baidu.com/s/1yzhZRQARAugyyBLk7EhOrg extraction code: 2 i7w