LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA write timeout?

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.

0 Kudos
Message 1 of 7
(1,067 Views)

How about using case structure? You can get the error code and you can terminate the run when there's an error?


 

emtisi_1-1690351724729.png

 

0 Kudos
Message 2 of 7
(1,045 Views)

@emtisi wrote:

How about using case structure? You can get the error code and you can terminate the run when there's an error?


 

emtisi_1-1690351724729.png

 


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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(1,016 Views)

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.

0 Kudos
Message 4 of 7
(1,006 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(999 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(978 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 7 of 7
(975 Views)