Mutual Joulescope UI and script usage

I would like to know if my use case is an error or a method not supported.

If I have the UI open to monitor statistics, I would like to use the python driver to do simple tasks to manage the device. One of them is to cycle the power of the DUT connected to the JS110.

Right now, while having the UI open and testing the “dut_power.py” from the “pyjoulescope_examples”, I get the following error:

device_open(u/js110/0XXXXXX) could not open device path \\?\usb#vid_XXXXX&pid_XXXX#{XXXXXX}
Traceback (most recent call last):
open_ll failed
  File "dut_power.py", line 51, in <module>
    run()
  File "dut_power.py", line 47, in run
    dut_power(power_on)
  File "dut_power.py", line 31, in dut_power
    with scan_require_one() as js:
  File "joulescope\v1\device.py", line 623, in __enter__
    self.open()
  File "joulescope\v1\device.py", line 363, in open
    rc = self._driver.open(self._path, mode, timeout)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pyjoulescope_driver\binding.pyx", line 844, in pyjoulescope_driver.binding.Driver.open
  File "pyjoulescope_driver\binding.pyx", line 588, in pyjoulescope_driver.binding._handle_rc
RuntimeError: jsdrv_open failed 1 | u/js110/XXXXXX

Should “scan_require_one” be able to work while the device is already opened by the UI?

Hi @MarcAndre and welcome to the Joulescope forum! Unfortunately, Joulescopes can only be opened by one program at a time. If the instrument is open in the UI, you cannot then connect to it from a script. If you are do not need to automate, you can easily configure the device and toggle device power through the UI.

I am going to assume you want to leave the Joulescope UI open while having some script automate a test. What features of the Joulescope do you need to control in this case? Is it only target power?

Thank you @mliberty for the answer.
I found a workaround. Disable the UI connection while I do the automated pass.

TLDR;
Close the UI connection to the device while you need to do automated scripts.

Joulescope UI>Device>Disable

1 Like

I just downloaded the UI (1.0.22) and this fix does not work anymore.

This is the new method.

  1. Open “device control”
  2. “Open and close the device”
    image
1 Like