title: Read OPC Values Utgard
body: <p>I have this code which is to read values from the kepware OPC Server</p>
  
  <pre><code>package opcread;
  import java.util.concurrent.Executors;
  import org.jinterop.dcom.common.JIException;
  import org.openscada.opc.lib.common.ConnectionInformation;
  import org.openscada.opc.lib.da.AccessBase;
  import org.openscada.opc.lib.da.DataCallback;
  import org.openscada.opc.lib.da.Item;
  import org.openscada.opc.lib.da.ItemState;
  import org.openscada.opc.lib.da.Server;
  import org.openscada.opc.lib.da.SyncAccess;
  
  public class OPCRead {
  
  
      public static void main(String[] args) throws Exception {
          // TODO code application logic here
          final ConnectionInformation ci = new ConnectionInformation();
          ci.setHost("localhost");
          ci.setDomain("MYDOMAIN");
          ci.setUser("MY_COMPUTER_USERNAME");
          ci.setPassword("MY_COMPUTER_PASSWORD");
          ci.setProgId("Kepware.KEPServerEX.V5\\MP.ANC1._System._Mode");
          ci.setClsid("B3AF0BF6-4C0C-4804-A122-6F3B160F4397");
          final String itemId = "_System._Time_Second";
  
          final Server server = new Server(ci, Executors.newSingleThreadScheduledExecutor());
  
          try
          {
              server.connect();
  
              final AccessBase access = new SyncAccess(server, 500);
              access.addItem(itemId, new DataCallback(){
                  @Override
                  public void changed(Item item, ItemState state){
                      System.out.println("Data change " + item + " : " + state);
                  }
  
              });
  
              access.bind();
  
              Thread.sleep(10*1000);
  
              access.unbind();
          }
          catch( final JIException e)
          {
              System.out.println("Errorrrrrrrr : " + String.format("%08X: %s", e.getErrorCode(),server.getErrorMessage(e.getErrorCode())));
          }
          catch(Exception ex)
          {
              System.out.println("Errorrrrrrrr : " + ex.getMessage());
          }
      }
  
  }
  </code></pre>
  
  <p>I want to read value present on <code>_Mode</code> tag. I have also given the full path above <code>Kepware.KEPServerEX.V5\\MP.ANC1._System._Mode</code>. But in result, it doesnt shows the values present on the tag i.e. <code>userRate</code>, rather it is giving the following message</p>
  
  <pre><code>Sep 12, 2015 9:10:57 PM rpc.DefaultConnection processOutgoing
  INFO: 
   Sending REQUEST
  Sep 12, 2015 9:10:57 PM rpc.DefaultConnection processIncoming
  INFO: 
   Recieved RESPONSE
  Data change org.openscada.opc.lib.da.Item@11d7dda : Value: [[org.jinterop.dcom.core.JIUnsignedInteger@11d4b2e]], Timestamp: Sat Sep 12 21:10:57 IST 2015, Quality: 192, ErrorCode: 00000000
  </code></pre>
  
  <p>In place of <code>org.jinterop.dcom.core.JIUnsignedInteger@11d4b2e</code>, it should print the value, but getting this message. What wrong I am doing here ?</p>