public void SerialPortPing(Dictionary <int, KeyBoardCounter> dicCounterKeyboard) { if (serialPort.openPort()) { byte[] byteRes = modBus.BuildText(DEVICE_KEYBOARD, dicCounterKeyboard.Values.ToArray()[0].AddressKeyboard, (int)CheckByteSend.BYTE_COMMAND.STATUS_COMMAND, "", 1); serialPort.SendData(byteRes); } }
static void Main(string[] args) { //InputParam(); comName = GetCom(comName); if (comName.Length > 0) { Init(); try { serialPort.openPort(); while (true) { } } catch (Exception ex) { log.sendLog("exception " + ex); } } return; }
private static void InitSerialPort(string comName) { serialPort = new MRW_SerialPort(new System.IO.Ports.SerialPort(comName.ToUpper(), 19200)); serialPort.openPort(); serialPort.DataReceived += serialPortDataReceived; }