OutOfRange in some array, write doesn't work

This commit is contained in:
nikzori
2024-12-17 16:55:55 +03:00
parent ab5c06df5e
commit 61546de4ca
2 changed files with 3 additions and 0 deletions

View File

@@ -474,6 +474,7 @@ namespace Gidrolock_Modbus_Scanner
switch ((FunctionCode)functionCode)
{
case (FunctionCode.WriteCoil):
Console.WriteLine("Trying to force single coil");
if (valueLower == "true" || valueLower == "1")
await Modbus.WriteSingleAsync(port, (FunctionCode)functionCode, (byte)UpDown_ModbusID.Value, (ushort)address, 0xFF_00);
else if (valueLower == "false" || valueLower == "0")