Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Open Visa Error

Hello everyone,

I would be very grateful if someone could help me.

I am trying to communicate with a spectrometer. All is working correctely until I turn it off.

When I turn it on after, I can not execute my program and I get the following error:

 

Error -1073807246: The resource is valid, but VISA cannot currently access it

 

When I go to MAX, my instrument is still existing but It is written "Unknown"

 

I have found an interesting page on ni.com explaning the reason behind this:

 

http://digital.ni.com/public.nsf/websearch/6807113B057FDE4C86256B41008212ED?opendocument&Submitted&&...

 

I understood that I am getting this error because the previous sessions are still open.

so I added  "close VISA" whenever I got any error when trying to open a session. In this case the instrument is not detected by MAX and I have to disconnect it and reconnect it.

Can anyone help me in finding a way to use my instrument without disconnection and reconnection it again?

Thanks

 

 

0 Kudos
Message 1 of 9
(5,013 Views)
What sort of physical connection do you have? If it's serial, you cannot have MAX and LabVIEW open at the same time and trying to access the port.
0 Kudos
Message 2 of 9
(5,005 Views)

It is a virtual COM. So it is USB working as a serial port.

Even if I close labview, the communication is lost.

Thanks.

F

0 Kudos
Message 3 of 9
(4,996 Views)
Turning the instrument off should have no affect unless the converter is internal to the instrument. If it is, then when turn it back on, you can do a manual refresh in MAX to make sure it is present before running any LabVIEW. If you are using an external converter, what is the chipset that it uses?
0 Kudos
Message 4 of 9
(4,988 Views)

Excuse my ignorance on this, but what converter are you talking about?

Thanks

F

 

0 Kudos
Message 5 of 9
(4,982 Views)

I wanted to use my instrument directly when turning it on. I don't want to bother the users by asking them to not turn it off or to check if MAX has detected it. They have not a proghramming backgrounds.

This is why I want to fix all the problems.

 

When I did some research I found that maybe the problem occurs because it is a USB port. So turning it off will end up the communication.

It is like a USB key. You have to disconnect it and reconnect it so that the OS will detect it again.

F

0 Kudos
Message 6 of 9
(4,980 Views)

Hi Feriel,

 Are you closing the VISA refnum after using it?

If not, be sure to do it after you finished using it on the program.

In your "intit VI", if the error occurs, you should close the ressource, and re-open it.

Regards,

 

Jovan N. - Application Engineering
0 Kudos
Message 7 of 9
(4,958 Views)

Hello,

In the Init.vi I am closing the visa ressource but I am not trying to open it again for one reason which is: When  i launch the init VI i am trying to open a new session. And because I can't I am getting the error.

Regards,

F

0 Kudos
Message 8 of 9
(4,922 Views)
1 do do not select visa resource correctly check device manger in window to find port
2 you select mistake bud rate or other setting check your device options
3 you hardware or related cable is broken check this with
hyper terminal software
0 Kudos
Message 9 of 9
(4,807 Views)