Fixed dispose on servers
This commit is contained in:
@@ -22,6 +22,19 @@ float voltage = registers.GetSingle();
|
||||
Console.WriteLine($"The voltage of device #{unitId} between L1 and N is: {voltage:N2}V");
|
||||
```
|
||||
|
||||
If you want to use the `ASCII` protocol instead, you can do this on initialization:
|
||||
|
||||
```csharp
|
||||
// [...]
|
||||
|
||||
using var client = new ModbusSerialClient(serialPort)
|
||||
{
|
||||
Protocol = new AsciiProtocol();
|
||||
};
|
||||
|
||||
// [...]
|
||||
```
|
||||
|
||||
|
||||
## Sources
|
||||
|
||||
|
||||
Reference in New Issue
Block a user