Problem:
- Unhandled exception occurs during ShotSearch execution.
- Error message: "Conversion from string 'The operation has timed out.'
to type 'Double' is not valid."
Reproduction:
- Occurs when the communication port is disconnected during the
"Information Input" state.
Cause:
- ShotSearch returns a timeout message as a string.
- Comparing this string directly to an integer (e.g., If ShotSearch() = 0)
causes a runtime type conversion exception.
Fix:
- Updated condition from:
If ShotSearch() = 0 Then
to:
If ShotSearch() = "False" Then
- Prevents runtime error by avoiding invalid comparison between string and integer.