08-18-2005 03:16 PM
08-19-2005 11:44 AM
Hello!
This sounds like an old error/warning message that is an old version of LabVIEW (4.x) and the VISA drivers. What version of LabVIEW (or CVI) and VISA are you using? This is a warning seen when trying to Open a VISA session with the instrument no connected or powered on. Did you close out the first VISA session before opening it again next time you talk to the instrument? This may be the source of the warning message. Please check these items and let me know if you need any additional assistance. Best of luck and have a great day!
Chris R.
Applications Engineer
National Instruments
08-19-2005 03:07 PM
08-22-2005 01:26 PM
Hi again,
Those VISA drivers should be fine, but an update to version 3.3 wouldn't hurt. If a VISA session is opened for communication and never closed, if you try to open it again, it may not work since the resource may be taken at the time of the write/read. Many functions that are executed include a VISA Close (or VISA Clear) which will do it for you. This may be why your instrument isn't found after the first communication with it. If you Scan for Instruments in Measurement and Automation Explorer (MAX), are you able to see your instrument? If so, can you communicate with it here. Do you see similar behavior here as in your program. Try another program, if possible, to see if the program itself may not be freeing a resource or identifying the instrument correctly. If a different program works, then the next step would be to troublshoot the code to see what is causing the problem. If you are still having trouble, please let me know what all you have tried (with any updates) and I can look into it further for you. Have a great day!
Chris R.
Applications Engineer
National Instruments
11-28-2012 05:50 PM
Hi Chris,
How can we access the return values of viOpen in C# by calling Open()? I am using VISA driver in C#, am looking to handle that error code VI_SUCCESS_DEV_NPRESENT when a wrong GPIB address is used , How can i handle that in C#.
I have another post "Session Returned by Open(resourceName) in NI-VISA in C# is valid ?" , but unable to get the answer , can u suggest more on it . "
am using ResourceManager.GetLocalManager().Open(resourceName) NI-VISA in C# . The function returns a session , my question is how do we know if this session is a valid session or not? i.e by valid i mean can we use it to send and recieve the commands to this session?
e.g I can get the 2 sessions by using following resource strings GPIB0::0::INSTR GPIB0::2::INSTR without any exception from below code
try
{
good_session = ResourceManager.GetLocalManager().Open(GPIB0::0::INSTR);
bad_session = ResourceManager.GetLocalManager().Open("GPIB0::2::INSTR");
}
catch (Exceptions ex)
{
}
The good_session can return successful return value to *IDN? command but the bad session returns the timeout error. Which means the Bad session was actually invalid one. because the primary address at which device is listening was '0' not the '2'
Is there a way to find out this session was actually invalid from visa documentation ?
I checked the documents that viOpen() returns 3 different values 0x3FFF007D (VI_SUCCESS_DEV_NPRESENT) etc , How can we access the return values of viOpen in C# by calling Open()