LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA lockout

I am using CVI  and VISA drivers to control two power supplies (HP6035A and Sorensen DCS600) via a NI HPIB USB controller .  After setting up the power supplies and reading in values from the supplies, the VISA drivers become unresponsive and return an error whenever I try to initialize them:
 
NON-FATAL RUN-TIME ERROR:   "SNDCSDLM.c", line 100, col 28, thread id 0x00000504:   Function viOpen: (return value == -1073807345 [0xbfff000f]). Specified type of lock cannot be obtained, or specified operation cannot be performed, because the resource is locked.
 
I do not explicitly lock or unlock anything, and once the system gets into this state, it will only clear itself with a system reboot.  Is there any way to reset the VISA driver or otherwise clear this condition?
 
Thanks.
0 Kudos
Message 1 of 3
(3,952 Views)
That error code means that the resource you're trying to access has been locked by another process. In this case, you probably didn't use a VISA close to close the previous VISA session. If that's the case, then you don't need to reopen that session. You should just be able to do reads and writes to the current session. If you want to reopen the session, then just make sure to end the process by using a VISA close when you're done with it elsewhere in the code.

Hope this helps!

-Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 2 of 3
(3,931 Views)
Matt is correct.  You seem to have a second call to SNDCSDLM_init() without making a call to SNDCSDLM_close() in the sorenson driver.  You can either leave the visa session active between commands to the instrument or call SNDCSDLM_close() when you are through and call SNDCSDLM_init() again when you want to reinitialize the dc source and start a new session.
0 Kudos
Message 3 of 3
(3,923 Views)