plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From udeho <ud...@student.kit.edu>
Subject PlcConnectionException
Date Mon, 11 May 2020 07:55:35 GMT
Dear PLC4X-Community,

I tried to do my first steps with modbus in PLC4X using the modbus simulator referenced in
your getting-started guide.
Following your instructions, I executed the following code to establish a connection:

public static void main(String [] args) {

                               String conString = "modbus://localhost";

                               try(PlcConnection plcCon = new
PlcDriverManager().getConnection(conString)){

                                               System.out.println("Hello Modbus");
                               }

                               catch (Exception e) {
                                               e.printStackTrace();
                               }
                }

Unfortunately, I get the following error:

org.apache.plc4x.java.api.exceptions.PlcConnectionException: Connection url doesn't match
the format 'modbus:{type}//{port|host}'
at
org.apache.plc4x.java.modbus.ModbusPlcDriver.connect(ModbusPlcDriver.java:69)
at
org.apache.plc4x.java.PlcDriverManager.getConnection(PlcDriverManager.java:72)
at plc4x.playground.main(playground.java:12)

Could you please give me a hint what I'm doing wrong or what is missing?
As far as I can see, I did it the same way you proposed in your virtual modbus section.

Thanks a lot!

Best regards
Tim

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message