07-25-2023 11:42 PM
I am getting data from the instrument using USB-GPIB. In normal condition, there is no problem.
If the USB contact is strange, it repeats disconnection and connection even if touched slightly.
Even if the program sets the timeout to 1.5 seconds, in the case of a connection problem, the Visa-write part that requests data falls into an infinite loop.
In development mode, the labview stop button does not work either.
Can hardware/labview give me an error?
labmaster.
07-26-2023 01:10 AM
How about using case structure? You can get the error code and you can terminate the run when there's an error?
07-26-2023 07:39 AM
@emtisi wrote:
How about using case structure? You can get the error code and you can terminate the run when there's an error?
No need for the case structure here. The VISA Write and VISA Read will not run if an error is passed to them. You can wire the error cluster straight to the stop condition to stop the loop when there is an error.
07-26-2023 08:04 AM - edited 07-26-2023 08:05 AM
Thanks for the response.
I concluded I cannot manage the error in case of connection failures.
In my case, all functions was stopped in labview due to the sudden trouble.
However, I need to change the connection.
07-26-2023 08:11 AM
Hi labmaster,
@labmaster wrote:
If the USB contact is strange, it repeats disconnection and connection even if touched slightly.
Even if the program sets the timeout to 1.5 seconds, in the case of a connection problem, the Visa-write part that requests data falls into an infinite loop.
There's a reason why often it is recommended NOT to use USB when it comes to "mission critical" communication with external devices…
07-26-2023 10:44 AM
@GerdW wrote:
Hi labmaster,
@labmaster wrote:
If the USB contact is strange, it repeats disconnection and connection even if touched slightly.
Even if the program sets the timeout to 1.5 seconds, in the case of a connection problem, the Visa-write part that requests data falls into an infinite loop.
There's a reason why often it is recommended NOT to use USB when it comes to "mission critical" communication with external devices…
There's a reason I avoid USB whenever possible. If the device is able to communicate over TCP (LXI compliant even better), I choose that over any other bus.
07-26-2023 10:47 AM
@crossrulz wrote:
@GerdW wrote:
Hi labmaster,
@labmaster wrote:
If the USB contact is strange, it repeats disconnection and connection even if touched slightly.
Even if the program sets the timeout to 1.5 seconds, in the case of a connection problem, the Visa-write part that requests data falls into an infinite loop.
There's a reason why often it is recommended NOT to use USB when it comes to "mission critical" communication with external devices…
There's a reason I avoid USB whenever possible. If the device is able to communicate over TCP (LXI compliant even better), I choose that over any other bus.
To add to this thought, if a physical serial port is available on the computer, I'll take that any day over a USB RS-232 adapter.