02-04-2016 05:43 AM
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:
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
02-04-2016 07:59 AM
02-04-2016 08:57 AM - edited 02-04-2016 08:58 AM
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
02-04-2016 10:10 AM
02-04-2016 11:06 AM
Excuse my ignorance on this, but what converter are you talking about?
Thanks
F
02-04-2016 11:26 AM
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
02-05-2016 04:31 AM
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,
02-08-2016 02:49 AM
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
02-18-2016 01:03 AM