public CommunicationData() { this.configuration = new ConfigData(); this.ComPortDataBits = 8; this.ComPortStopBits = StopBits.One; this.comPort = new ModbusRtu(); }
public bool TestPort() { var testPort = new ModbusRtu(); var result = testPort.Open( this.ComPortName, this.ComPortBaudRate, this.ComPortDataBits, this.ComPortParity, this.ComPortStopBits); if (result) { result = testPort.Close(); } return result; }