Menu

How to install easymodbus.dll

Anonymous
2015-05-13
2015-06-11
  • Anonymous

    Anonymous - 2015-05-13

    Hello,

    I try to use the code example with Sharpdevelop. But i don't find how to install the easymodbus.dll on my system to be recognize, i have try to install it on windows/system32 with "regsvr32 easymodbus.dll" but don't work.

    The example code :

    /
    * Modbus Client Example
    /
    using System;
    using EasyModbus;

    namespace ModbusClientApplication
    {
    class Program
    {
    public static void Main(string[] args)
    {
    ModbusClient modbusClient = new ModbusClient("190.201.100.100", 502);
    //Connect to Server
    modbusClient.Connect();
    //Write Coils starting with Addres 5
    modbusClient.WriteMultipleCoils(4, new bool[] {true, true, true, true, true, true, true, true, true, true});
    //Read 10 Coils from Server, starting with address 10
    bool[] readCoils = modbusClient.ReadCoils(9,10);
    //Read 10 Holding Registers from Server, starting with Address 1
    int[] readHoldingRegisters = modbusClient.ReadHoldingRegisters(0,10);

            // Console Output
            for (int i = 0; i < readCoils.Length; i++)
                Console.WriteLine("Value of Coil " + (9 + i + 1) + " " + readCoils[i].ToString());
    
            for (int i = 0; i < readHoldingRegisters.Length; i++)
                Console.WriteLine("Value of HoldingRegister " + (i + 1) + " "+ readHoldingRegisters[i].ToString());         
            //Disconnect from Server
                    modbusClient.Disconnect();                      
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
    

    }

     
  • Rossmann Engineering

    You just have to add the easymodbus.dll as new reference. But if you use the example, and keep the folders, there is no need to install the dll.

     
    • Anonymous

      Anonymous - 2019-05-22
      Post awaiting moderation.
  • Anonymous

    Anonymous - 2017-09-07
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel