I'm writing an application that runs a Modbus slave. Within the application, I need to check the register address of requests, but they all evaluate to 0. I have tracked the issue to ModbusTCPTransport where createModbusRequest(int functionCode) is called, calling the parameterless constructor of the specific ModbusRequest class. setReference is never called on the request (anywhere that I can see).
I'm currently trying to acquire the reference in the following way:
int reference = ((WriteSingleRegisterRequst) this.request).getReference();
How do I properly get the reference of TCP requests?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And now I just realized v2.1 uses SLF4J, which isn't supported on the platform I'm planning to run my application on (Compact Profile). Can anyone help me with the above issue?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm writing an application that runs a Modbus slave. Within the application, I need to check the register address of requests, but they all evaluate to
0
. I have tracked the issue toModbusTCPTransport
wherecreateModbusRequest(int functionCode)
is called, calling the parameterless constructor of the specificModbusRequest
class.setReference
is never called on the request (anywhere that I can see).I'm currently trying to acquire the reference in the following way:
int reference = ((WriteSingleRegisterRequst) this.request).getReference();
How do I properly get the reference of TCP requests?
I just realized there was a maven repo and am going to try out v2.1
Just in case, though, the above issue happened on v1.06
And now I just realized v2.1 uses SLF4J, which isn't supported on the platform I'm planning to run my application on (Compact Profile). Can anyone help me with the above issue?
Sorry, nevermind. I created an MCVE and when the issue reproduced I checked the master. Turns out the master was configured incorrectly.