public void InitSerialSocketController(string comName) { modBus = new MRW_ModBus(); serialPort = new MRW_SerialPort(comName); serialRecive = new SerialReciveController(); //event recive serialPort.DataReceived += serialRecive.Recive; serialRecive.DataReceived += dataRecive; }
private static void InitSerialPort(string comName) { serialPort = new MRW_SerialPort(new System.IO.Ports.SerialPort(comName.ToUpper(), 19200)); serialPort.openPort(); serialPort.DataReceived += serialPortDataReceived; }