title: Reading Different Elements from Modbus-TCP
body: <p>I'm trying to figure out how to read different values from a modbus device (Powerscout 24) for different elements. There is a manual <a href="http://www.dentinstruments.com/hs-fs/hub/472997/file-2376767200-pdf/Pdf_Files/PS24_Manual.pdf?t=1459525636701" rel="nofollow">here</a> which says</p>
  
  <blockquote>
    <p>ADDRESSING AN ELEMENT</p>
    
    <p>The PowerScout 24 has eight elements. Modbus and BACnet each use
    different ways to designate an element on the PS24. In Modbus mode,
    the decimal network switches set the base address for metering element
    “A.” Metering elements “B” through “H” will always have a Modbus
    address that is one higher than the element before. For example, if
    the rotary address switches are set to 001 then metering element “A”
    register values will be accessed at Modbus address 001, element “B”
    registers will be accessed at Modbus address 002, element “C” at
    address 003, and so on.</p>
  </blockquote>
  
  <p>So from my understanding, if i wanted to read the value at register 4012 on Element A (or Slave 1) I would read the holding register at 4012.</p>
  
  <p>If i wanted to read Element B, the register would be 4013? But how can this be, 4013 is used for a different value - Displacement PF System. (Check top of page 65)</p>
  
  <p>I've tried using this library <a href="http://easymodbustcp.net/category/codesamples" rel="nofollow">EasyModbusTCP</a></p>
  
  <pre><code>ModbusClient modbusClient = new ModbusClient("192.168.1.250", 502);    //Ip-Address and Port of Modbus-TCP-Server
  modbusClient.Connect();                                                    
  int[] readHoldingRegisters = modbusClient.ReadHoldingRegisters(4000,1);
  //Read 10 Holding Registers from Server, starting with Address 1
  </code></pre>
  
  <p>I've tested this and it works in the sense that it can only read registers for element A (slave 1). I havent been able to figure out how to read registers for the other elements.</p>
  
  <p>I checked the other part of the library (RTU - read from serial ports) and this defines a slave to read from, but I need to read the device over TCP not serial so I cant implement it this way.</p>
  
  <p>Can anyone explain how I can read different elements via TCP?</p>