private static void FetchOneItem(Socket socket, bool paramsToWriteExists, RequestData par) { switch (par.ParameterKind) { case LogikaParam.Parameter: if (paramsToWriteExists && par.ModbusTable == ModbusTable.Holdings) { var value = Modbus.GetParamValue(new ParamAddr(par.NodeAddr, Modbus.ModifyToModbusRegisterAddress(par.StartAddr, ModbusTable.Holdings))); if (!string.IsNullOrWhiteSpace(value)) { Logika.WriteToParameter(socket, par, value); } } Logika.FetchParameter(socket, par); break; case LogikaParam.IndexArray: { if (paramsToWriteExists && par.ModbusTable == ModbusTable.Holdings) { var value = Modbus.GetParamValue(new ParamAddr(par.NodeAddr, Modbus.ModifyToModbusRegisterAddress(par.StartAddr, ModbusTable.Holdings))); if (!string.IsNullOrWhiteSpace(value)) { Logika.WriteToIndexArray(socket, par, value); } } Logika.FetchIndexArray(socket, par); } break; } }