Menu

How to connect using USB cable

2020-03-14
2020-03-19
  • Arun Mahajan

    Arun Mahajan - 2020-03-14

    I am trying to read an Omron PLC from a C# program. I have connected Omron PLC with my laptop using USB cable. In the program while I am trying to make an object I am failed to understand what value should I provide in the connect method:

    EasyModbus.ModbusClient modbusClient = new EasyModbus.ModbusClient("Com4", 502);

    instead of Com4 it MUST need to provide some value so that it can understand that it is a USB port which needs to be connected.

    Please note that this is a direct USB cable no convetor.

    Could you please help me to provide help on it.

     
    • Rossmann Engineering

      I am not sure if your Omron PLC proviedes Modbus Slave funktionalities, but you are using the constructor for Modbus-TCP if you try to connect via serial Port that can only be Modbus-RTU. Your USB to serial converter should add a COM-Port. If you are using Modbus-RTU you should use EasyModbus.ModbusClient modbusClient = new EasyModbus.ModbusClient("Com4");

       

Anonymous
Anonymous

Add attachments
Cancel