Reset accumulators using pyjoulescope_driver

I am developing a straightforward program that performs the following steps:

  1. Captures a datapoint from a Joulescope device.
  2. Modifies certain settings on other measurement devices.
  3. Captures another datapoint, and so on in a loop.

I found some example code on the Joulescope forum (Get actual input voltage - Technical Discussion) that helped me achieve this. However, I’ve noticed an issue: the accumulators are not reset when restarting the program.

While I discovered that the device class has a function called statistics_accumulators_clear() to reset accumulators, I couldn’t find a similar function in the driver class. Does the driver class offer a way to achieve this?

Additionally, I learned that settings on the device can be changed using the publish method, as shown in the example:

jsdrv.publish(f'{device_path}/s/i/range/select', 'auto')

I would like to know about all functionality available through the publish method. Is there an overview or documentation listing all commands and their expected parameters?

I solved this. First, the question about all topics that you can publish to was answered here: Query, publish and subscribe to topics - Technical Discussion - Joulescope. It is by using the command:

python -m pyjoulescope_driver info -v "*"

Next, you can reset the accumulators using:

jsdrv.publish(f'{device_path}/s/stats/!clear', 1)
1 Like

Hi @MWW and welcome to the Joulescope forum!

Great to hear you were able to solve this, and thank you for posting the solution!

1 Like