Ejemplo n.º 1
0
 /// <summary>
 /// Adds an additional master interface with an custom device id mapping
 /// </summary>
 /// <param name="masterInterface">master interface to add</param>
 /// <param name="timeout">Timeout for master interface</param>
 /// <param name="addressMap">A hashtable where the key is the incoming device id that is mapped to it's value as device id on the master interface.
 /// Both, key and value of the hashtable must be of type byte.</param>
 public void AddMaster(IModbusInterface masterInterface, int timeout, Hashtable addressMap)
 {
    masterInterface.PrepareWrite();
    foreach (byte sourceAddress in addressMap.Keys)
    {
       _masterMap[sourceAddress] = new GatewayMaster(masterInterface, (byte)addressMap[sourceAddress], timeout);
    }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds an additional master interface with an custom device id mapping
 /// </summary>
 /// <param name="masterInterface">master interface to add</param>
 /// <param name="timeout">Timeout for master interface</param>
 /// <param name="addressMap">A hashtable where the key is the incoming device id that is mapped to it's value as device id on the master interface.
 /// Both, key and value of the hashtable must be of type byte.</param>
 public void AddMaster(IModbusInterface masterInterface, int timeout, Hashtable addressMap)
 {
     masterInterface.PrepareWrite();
     foreach (byte sourceAddress in addressMap.Keys)
     {
         _masterMap[sourceAddress] = new GatewayMaster(masterInterface, (byte)addressMap[sourceAddress], timeout);
     }
 }