Menu

m_Reference is always 0

2016-05-20
2016-05-23
  • Adam Jensen

    Adam Jensen - 2016-05-20

    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?

     
    • Adam Jensen

      Adam Jensen - 2016-05-20

      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

       
      • Adam Jensen

        Adam Jensen - 2016-05-21

        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?

         
  • Adam Jensen

    Adam Jensen - 2016-05-23

    Sorry, nevermind. I created an MCVE and when the issue reproduced I checked the master. Turns out the master was configured incorrectly.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.