Hi Alessio,

welcome on this super-cool community list of ours :-)

Unfortunately I have a little "uncool" news ... while working on the new 
drivers, it occurred to me that we currently are absolutely able to run one 
protocol over multiple transports, however if the transports require different 
handling on the lowest level, we currently haven't got that base covered. 

We started discussing options on how to solve this problem, but the discussion 
is ongoing ... 

Unfortunately I didn't update the documentation ... as I thought we'd be able 
to implement this sooner. 

Possibly the 0.6.x version of PLC4X could work as starting with 0.7.0 we have 
deleted all existing drivers and have replaced them with new, generated ones 
and are still working on implementing all the features the old ones had. 
Unfortunately you seem to be the first person to ask for serial Modbus, so we 
hadn't prioritized that up too much.

So for now .. please give the 0.6.1 a go (might have slightly different syntax 
and connection string) and join in on the discussion here on the list and 
possibly help us finish this ... as none of us have a serial Modbus device, 
it's sort of tricky to implement a driver for it.

Chris




Am 02.09.20, 16:50 schrieb "Alessio Bernesco Làvore" 
<[email protected]>:

    Hi everyone,

    i'm trying to complete some tests connecting a Modbus RTU device (digital
    input converter).

    The device is connected using a USB/485 converter, running with pyModbus
    i'm able to communicate with the device.

    I'm using this connection string:

    PlcConnection plcConnection = new
    
PlcDriverManager().getConnection("modbus:serial:///dev/ttyUSB0?unit-identifier=1");

    Then:
    PlcReadRequest.Builder builder = plcConnection.readRequestBuilder();
    builder.addItem("value-0", "holding-register:14");
    PlcReadRequest readRequest = builder.build();
    PlcReadResponse response = readRequest.execute().get();

    But i was unable to obtain a response, watching at the logs there are
    plenty of:
    io.netty.channel.nio.NioEventLoop        : Migrated 1 channel(s) to the new
    Selector.
    Selector.select() returned prematurely 512 times in a row; rebuilding
    Selector
    org.apache.plc4x.java.transport.serial.SerialPollingSelector@37f2b566.

    Another important part is that i'm unable to find where i can configure the
    serial communication parameters, like baud rate, stop bits, etc.

    Greetings,
    Alessio

Reply via email to