Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Close Labjack U3 in python program running on Windows platform

labjack python close

  • Please log in to reply
1 reply to this topic

#1 ferryard

  • Members
  • 3 posts

Posted 11 November 2014 - 09:27 PM

Hello, I tried to access Labjack U3-HV from two files using labjack-python. The first file will get access to the labjack and after it has finished, the second file will get access to labjack. The first file will keep running while the second file use Labjack. Before giving Labjack access to second file, I have close labjack device in first file using: d.close(), but I still can not access Labjack from the second file and it returns : Labjack is already open via usb in another program or process. Is there any proper way to close Labjack so that I can access it from another program?

Thanks in advance.

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 12 November 2014 - 12:29 PM

The Windows UD driver can only close all opened devices in a process, so the device's close call does nothing since it is meant to close an individual device which isn't supported. A device's close call (for example d.close()) is only supported on Linux and Mac OS X.


To close all open device's in the process (Windows only) use the Close function from the LabJackPython module. For example:

import LabJackPython

# ...

LabJackPython.Close() #Close all UD driver opened devices in the process

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users