Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

why do I get vi_success_dev_npresent error

I had talked to an instrument previously but next time I talk to the same instrument I get a  VI_SUCCESS_DEV_NPRESENT_ERROR with the message Session opend successfully, but the device at the specified address is not responding. Can anyone tell me why?
0 Kudos
Message 1 of 5
(3,948 Views)

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

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,939 Views)
Chris, I am using version 3.0.1 of Visa I'm not using labview or cvi Im using c++ that is calling VISA directly. When the error happens the previous station is still open.
0 Kudos
Message 3 of 5
(3,933 Views)

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

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,920 Views)

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()

0 Kudos
Message 5 of 5
(3,392 Views)