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

Reply via email to