Open wecoxSand opened 2 years ago
It all boils down to this deprecable getter/setter
public Parity Parity
{
get
{
if (serialport != null)
return parity;
else
return Parity.Even;
}
set
{
if (serialport != null)
parity = value;
}
}
Definining a property with the same name of an enum is a terrible idea. Also Parity.Even is returned when serialport is null.
Using an empty constructor to generate a ModbusClient, then setting its properties. Setting
ModbusClient.Parity = Parity.None;
before calling.Connect()
results in the internal serialport still creating withParity.Even