public Chr4Elgen() { _PwrBus = new PwrModbus(ePWRTYPE.ElgenCharger); _PwrBus.Evt_ModBusConnection += On_Connection; _StateChk.Interval = 1000; _StateChk.Elapsed += _State_Elapsed; }
public void Close() { _StateChk.Stop(); if (null != _PwrBus) { _PwrBus.Close(); _PwrBus = null; } }
public void Close() { _StateChk.Stop(); if (false == bUseModbus) { _PwrCom.Close(); _PwrCom = null; } else { if (null != _PwrBus) { _PwrBus.Close(); _PwrBus = null; } } }
public Bat4Elgen() { if (false == bUseModbus) { _PwrCom = new SerialPort(); _PwrCom.BaudRate = 9600; _PwrCom.DataBits = 8; _PwrCom.Parity = Parity.None; _PwrCom.StopBits = StopBits.One; _PwrCom.DataReceived += SerialPort_DataReceived; } else { _PwrBus = new PwrModbus(ePWRTYPE.ElgenBattery); _PwrBus.Evt_ModBusConnection += On_Connection; } _StateChk.Interval = 1000; _StateChk.Elapsed += _State_Elapsed; }