Multimeter update frequency/period

Hi,

I took delivery of my JS220 yesterday. Very pleased with it, never used one before and so far so good. I expect it will become indispensable to me.

Other than using “Accrue” button on the UI, Is it possible to change the update period from 500ms to say 400ms (2.5 times per second which a lot of industrial panel meters update at and I have found to be optimal for a number of use cases), 1 second and perhaps 2 seconds ?

If not would this be something you would consider implementing?

Hi @deonm and welcome to the Joulescope forum!

1 Hz

The Joulescope UI easily allows you select 1 Hz today:

So, that leaves 2.5 Hz and 0.5 Hz from your request.

2.5 Hz

The JS220 supports computing statistics over any arbitrary number of samples 1,000 (1 kHz) to 1,000,000 (1 Hz). Although the UI constrains choices to the standard 1, 2, 5 sequence, the JS220 does not.

I don’t see a reason to break the standard 1, 2, 5 sequence to add 2.5 Hz to the UI. I could see adding a “custom” setting, but that does not exist today. If you want 2.5 Hz today, you can hack the UI source code to add 2.5 Hz. You first have to clone the pyjoulescope_ui git repo and get it running in Python on your host computer. You can follow the instructions in the README.md.

Modify the joulescope_ui/devices/jsdrv/js220.py file:

  1. Change statistics_frequency dtype to float
  2. Add [2.5, ‘2.5 Hz’] as an option
  3. Change scnt = 1_000_000 // value to scnt = int(1_000_000 / float(value))

You can then select 2.5 Hz, like this:

Here is the diff:

diff --git a/joulescope_ui/devices/jsdrv/js220.py b/joulescope_ui/devices/jsdrv/js220.py
index 92b03cc..d57a41b 100644
--- a/joulescope_ui/devices/jsdrv/js220.py
+++ b/joulescope_ui/devices/jsdrv/js220.py
@@ -176,7 +176,7 @@ _SETTINGS_CLASS = {
         'default': 1_000_000,
     },
     'statistics_frequency': {
-        'dtype': 'int',
+        'dtype': 'float',
         'brief': N_('Statistics frequency'),
         'detail': N_("""This setting controls the output frequency for
             the statistics data that is displayed in the
@@ -188,6 +188,7 @@ _SETTINGS_CLASS = {
             [20, '20 Hz'],
             [10, '10 Hz'],
             [5, '5 Hz'],
+            [2.5, '2.5 Hz'],
             [2, '2 Hz'],
             [1, '1 Hz'],
         ],
@@ -746,7 +747,7 @@ class Js220(Device):
         elif topic == 'signal_frequency':
             self._driver_publish('h/fs', int(value), timeout=0)
         elif topic == 'statistics_frequency':
-            scnt = 1_000_000 // value
+            scnt = int(1_000_000 / float(value))
             self._driver_publish('s/stats/scnt', scnt, timeout=0)
         elif topic == 'target_power':
             self._current_range_update()

0.5 Hz

Adding [0.5, '0.5 Hz'] like we did with 2.5 Hz does not work, since the JS220 limits itself to a maximum window of 1,000,000 samples. This ensures that the accumulation stays within the numerical precision used by the JS220. However, you can combine statistics on the host side, as the accrue feature does today. Neither the Joulescope driver, Joulescope UI, nor Multimeter widget has a combine N statistics feature today, but downsample_logging.py does. Does 1 Hz in the UI with the option to record at 0.5 Hz using downsample_logging.py work for you?

Thanks for your response,
I applied the patch as above and it works perfectly for the 400ms thing.
I have not tried the 2 second (1/2 Hz) one using `downsample_logging.py`, as it is I am happy with it.

It would be useful in future if possible to be able to change the statistics frequency from the Multimeter panel. Even if it means toggling through all the supported options.

Hi @deonm - Great!

We have been very careful to maintain Joulescope device settings separate from widget settings. What you may not seen yet is that the UI supports multiple widgets displaying the potentially same data, and multiple simultaneous Joulescopes. Keeping device settings separate from widget settings keeps everything sane. Otherwise, you may change a widget setting that unintentionally affects another widget or another Joulescope.

We have made accessing the Joulescope device settings easy and quick!

1 Like