Table of Contents

Current API v5 — Software ≥ 4.1

An updated API client is available for EMScope software version 4.1 and later. It extends the v4 interface with several protocol and usability improvements:

The api_v5.py and api_example_v5.py files are provided. The api_example_v5_multi_detector.py file demonstrates simultaneous PK + QP + AV measurement using parallel connections. The api_example_v5_modal.py file measures user-defined modal channels on a three-phase instrument.

Required libraries: websockets, matplotlib. Python 3.8 or later is required.

For a detailed description of the underlying WebSocket protocol, refer to the WebSocket API documentation.

In modal mode (set_mode(“modal”)) every modal channel is a weighted sum of the instrument inputs, computed before the FFT: c1·In1 + c2·In2 + …. The coefficients are defined with set_modal_coefficients() and require the advanced_modal license (request_licenses() lists it). Without the license the server ignores them and does not reply.

Configuration Selected with Modal channels Inputs c1, c2, c3, c4
emi RX2 cm, dm L, N
emi_3p_no_neutral RX4, set_neutral(False) cm, dm1, dm2, dm3 L1, L2, L3
emi_3p_neutral RX4, set_neutral(True) cm, dm1, dm2, dm3 L1, L2, L3, N

The api_example_v5_modal.py file measures the common and the differential mode of each phase against the neutral (six channels) with two coefficient configurations, one after the other.


Legacy APIs

Software ≤ 3.13

The api.py and api_example.py files are provided for use with EMScope software versions 3.13 and earlier.

Required libraries: websockets, json. The matplotlib library is used in the example script.

API v4 — Software = 4.0

A fully redesigned API client is available for EMScope software version 4.0. It introduces a cleaner interface, automatic RBW and display range management, robust session handling, and transparent keepalive ping/pong support.

The api_v4.py and api_example_v4.py files are provided.

Required libraries: websockets, matplotlib. Python 3.8 or later is required.