It appears there is a bug in the timeout of the ping command, anything less than 500 ms will default to 500ms. It will work with multiples of 500 ms.
Are you going to test out the new driver?
Dim PingSender As Ping = New Ping()
Dim PLCIsConnected As Boolean() = Nothing
Dim lines() As String = ReadAllLines(".\PLCDevicesList.txt")
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Debug.Print(DateTime.Now())
Dim i As Integer = 0
ReDim PLCIsConnected(lines.Count() - 1)
For Each lineItem In lines
Dim PingResponse As PingReply = PingSender.Send(lineItem, 500, Encoding.ASCII.GetBytes(1), New PingOptions(64, True))
If PingResponse.Status = IPStatus.Success Then
PLCIsConnected(i) = 1
Else
PLCIsConnected(i) = 0
End If
i = i + 1
Next
Debug.Print(DateTime.Now())
End Sub
Archie, how about adding a function 'IsConnected' to the driver? Other drivers I have seen, they all have that feature.