Making the ModbusExample work for RTU

Hello,

I’m trying to make the ModbusExample (the one that comes with the SDK) work for the serial support. I figured how to enable the serial driver (it seems that all needed has already been written).
However, i’m facing two problems:

  • I can not display the “Addresses” page. Whatever I change in the code, only the title is displayed.
  • I’m stuck with the first instruction of the connect() method from SerialIODelegate:
SerialPortLocal serialPort = new SerialPortLocal(serialConfig);

The serialConfig seems correct as serialConfig.getSettingsString() returns the good parameters. In the Gateway console I can see no error about the execution. Moreover, I can access (open/read/write/close) the serial port from an external application.

My question is : Is the RTU part of the ModbusExample is supposed to be fully functionnal ?

I can provide logs and code if needed.

Thank you in advance.

1 Like

We just discovered there’s a build issue that prevents one of the necessary serial-related jars from getting packaged in the module. If you modified the examples slightly you’d be able to catch a ClassNotFoundException when it tries to instantiate a SerialPortLocal or AsyncSerialoSession (forget which). Once we fix this issue it should work again.

Thank you Kevin.