public void SendAsSlave(ModbusTransferData transferData) { if (!_connected) { OnMastersDataReceived(transferData.EncodeTransferData(), 1); } else { _modbusSlavesClient.WriteLine(transferData.EncodeTransferData()); } }
public void SendAsMaster(ModbusTransferData transferData, byte masterIdentifier) { _logger.WriteDebug("-------------------------------------------------------------------"); if (!_connected) { OnSlavesDataReceived(transferData.EncodeTransferData()); } else { _modbusMasterClients[masterIdentifier].WriteLine(transferData.EncodeTransferData()); } }