Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No try catch error when using none existing UnitIdentifier #91

Open
KeepITSimpleSolutions opened this issue Feb 6, 2023 · 0 comments
Open

Comments

@KeepITSimpleSolutions
Copy link

I never get an exception when using an UnitIdentifier that does not exists...

In short.. IP = OK.... PORT = OK...

For x = 1 To CInt(Trim(args(3)))
Try
Dim modbusClient As New EasyModbus.ModbusClient(Trim(args(1)), Trim(args(2))) With {
.UnitIdentifier = CByte(x),
.ConnectionTimeout = 5000
}
modbusClient.Connect()
If modbusClient.Connected Then
...
End If
modbusClient.Disconnect()
Catch ex As Exception
Console.WriteLine("ERROR = " & ex.Message)
End Try
Next
System.Threading.Thread.Sleep(10000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant