コード例 #1
0
 public void SendAsSlave(ModbusTransferData transferData)
 {
     if (!_connected)
     {
         OnMastersDataReceived(transferData.EncodeTransferData(), 1);
     }
     else
     {
         _modbusSlavesClient.WriteLine(transferData.EncodeTransferData());
     }
 }
コード例 #2
0
        public void SendAsMaster(ModbusTransferData transferData, byte masterIdentifier)
        {
            _logger.WriteDebug("-------------------------------------------------------------------");

            if (!_connected)
            {
                OnSlavesDataReceived(transferData.EncodeTransferData());
            }
            else
            {
                _modbusMasterClients[masterIdentifier].WriteLine(transferData.EncodeTransferData());
            }
        }