public override void ManuelProcess(string Islem, string PlcCommand) { if (Status != ConnectionStatus.Opened) { Bits_Per_Second = 4800; Data_Bits = 7; Parity = System.IO.Ports.Parity.Even; Stop_Bits = StopBits.One; Connect(); if (Status != ConnectionStatus.Opened) { return; } } MeterRead = Sp.ReadExisting(); if (MeterRead == "") { Status = ConnectionStatus.Error; clsMessage.ErrorTanim = "Connection Problem"; clsGeneral.MeterConnect = "!"; Meter = 0; Sp.Close(); return; } else { if (Status != ConnectionStatus.Opened) { Bits_Per_Second = 4800; Data_Bits = 7; Parity = System.IO.Ports.Parity.Even; Stop_Bits = StopBits.One; Connect(); if (Status != ConnectionStatus.Opened) { return; } } if (clsAyar.MeterFormat.Length > MeterRead.Length) { return; } if (!clsGeneral.WriteMeterIndicator(Sp, "Meter", PlcCommand, out ReturnedValue)) { return; } clsGeneral.MeterConnect = ""; } try { Meter = ReturnedValue.ToDouble(); Sp.DiscardInBuffer(); } catch { } Sp.DiscardInBuffer(); Sp.DiscardOutBuffer(); }