Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

MessageBasedSession and VI_ERROR_CONN_LOST

Hello, I am using NI VISA .Net library's MessageBasedSession to communicate with instruments (all on local machine). My problem is whenever I unplug and plug back in the USB cable, then send commands using the original MessageBasedSession object, VISA reports back Error code: 1073807194 | VI_ERROR_CONN_LOST.

 

Do I MUST instantialize a new MessageBasedSession session, or is there a way to re-establish the connection using the existing session? Due to the structure of the app I am developing, it would be great if I don't have instantialize a new object.

 

Thanks

0 Kudos
Message 1 of 7
(6,978 Views)

Hi,

 

Your best bet would be to close and re-open the VISA connection to your device, when you receive this error.  The commands for this are viClose and viOpen.  This is the only way to recover from a connection error like this.

Shelby S
National Instruments
Applications Engineer
0 Kudos
Message 2 of 7
(6,953 Views)

Hi Shelby

 

I have also got the same problem. I my situation is that I have two instruments connected by GPIB-USB.

And my application is using a thread to get 66332A power supply current readings via GPIB_Read.

In the cycling test. I will get the same error VI_ERROR_CONN_LOST and the instruments goes to LOCAL mode from REMOTE. Also can not re-open the session in my application.

 

This can recover by re-open my application. Is there any ideas?

The following is from the NI I/O trace.

GPIB Error.png

 

0 Kudos
Message 3 of 7
(6,488 Views)

Hello Sam687777,

 

I would like to know why does the session can’t be reopen? Also you can consider the option to reinitialize your GPIB when the error occurs. You can use this guide for that:

 

http://digital.ni.com/public.nsf/allkb/62BB94BB841025F586256B2900634D86?OpenDocument

 

Finally I would recommend opening a new forum post so your issue can be attended in a better way.

 

Regards,

Jose R
0 Kudos
Message 4 of 7
(6,467 Views)

Hi Jose

 

When the VI_ERROR_CONN_LOST, I can't not reopen the session and also can not use SendIFC() function to interface clear.

It just can be recover by re-open the application.

 

However, I change my hardware from GPIB-USB-B to GPIB-USB-HS. The VI_ERROR_CONN_LOST error never happened again.

Do you have any idea of this.

 

Regards

0 Kudos
Message 5 of 7
(6,426 Views)

Hi,

 

Did you find the solution ?

Because i have the same issue and i don't know what to do.

 

Thanks,

N

0 Kudos
Message 6 of 7
(5,940 Views)

Hi N,

 

It appears as though this forum post is a little old. In order for your post to get more activity and better seen it would be best to create a new forum post on this topic.

 

Thanks and good luck!

Will.i.am10

0 Kudos
Message 7 of 7
(5,885 Views)