Skip to main content

Python SDK for accessing vibration and sensor data from IFM VSE systems and VSA devices via a reverse-engineered communication protocol.

Project description

pyvse

Python SDK for IFM VSE100 / VSA004 acceleration sensors. Reverse-engineered communication protocol. Not affiliated with or endorsed by IFM.

Install

pip install pyvse

Dependencies: numpy (required), pandas + matplotlib (optional, for export/visualization).

Quick start

One-shot collect

import pyvse

with pyvse.connect("192.168.0.1") as client:
    data = client.raw("50K").collect(seconds=5.0)
    data.to_csv("run1.csv")
    df = data.to_dataframe()   # pandas DataFrame: time_s, accel_g
    arr = data.to_numpy()      # np.ndarray shape (N,), unit: g

Live stream

import pyvse

with pyvse.connect("192.168.0.1") as client:
    for frame in client.raw("50K").stream(batch_size=700):
        print(frame.g_values.mean())   # np.ndarray shape (700,), unit: g

Stream to CSV (memory-efficient)

import pyvse

with pyvse.connect("192.168.0.1") as client:
    with pyvse.CSVSink("run1.csv", sample_rate=50_000) as sink:
        for frame in client.raw("50K").stream():
            sink.push(frame.g_values)

Stream to PlotJuggler

import pyvse

with pyvse.connect("192.168.0.1") as client:
    with pyvse.PlotJugglerSink() as pj:          # default: 127.0.0.1:9870 UDP
        for frame in client.raw("50K").stream():
            pj.push_all(frame.g_values)           # one UDP message per sample

API reference

pyvse.connect(host, port=3321, timeout=5.0) → VSEClient

Returns a context manager. Use with to ensure clean disconnect.

VSEClient

Method Returns Description
raw(rate="50K") RawCommand rate: "50K" or "100K"

RawCommand

Method Returns Description
collect(seconds) RawData Collect fixed-length capture
stream(batch_size=700) Iterator[RawFrame] Live stream; runs until interrupted

RawData

Attribute / Method Description
g_values np.ndarray shape (N,), float64, unit: g
sample_rate int, Hz
time_axis np.ndarray of timestamps in seconds
to_numpy() Returns g_values
to_dataframe() pandas DataFrame with columns time_s, accel_g
to_csv(path) Write CSV with time_s, accel_g columns

RawFrame

Attribute Description
g_values np.ndarray shape (batch_size,), float64, unit: g
sample_rate int, Hz

CSVSink(path, sample_rate)

Stream-friendly CSV writer. Use as context manager, call .push(g_values) per frame.

PlotJugglerSink(host="127.0.0.1", port=9870)

Pushes data to PlotJuggler via UDP JSON streamer.

Method Description
push(g_values, channel="accel_g") Send batch mean as single message
push_all(g_values, channel="accel_g") Send each sample as individual message

Exceptions

Exception Raised when
VSEConnectionError TCP connect fails
VSETimeoutError Socket read times out
VSEProtocolError Unexpected response from device
VSEError Base class for all pyvse errors

Disclaimer

Independent implementation developed through observation of device communication. Not affiliated with or endorsed by IFM.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvse-0.0.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvse-0.0.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file pyvse-0.0.1.tar.gz.

File metadata

  • Download URL: pyvse-0.0.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyvse-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e1d117c0aae79a0cbc16eb29bb45436ea598ed9698c8d16e404fc3ac6ecb82eb
MD5 fa39eee22d976f8b3c509346acc24cd2
BLAKE2b-256 7c52163edd3324419d39d72ecd1f49dcabe2f11aed9cba671671b7d11ba565af

See more details on using hashes here.

File details

Details for the file pyvse-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyvse-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyvse-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbfc800dcea9c7b5789fcc7eac0853aa29a3dd28cf205720ae224566a2c3a892
MD5 d361d626a2491fab6d9c9f515f5183fa
BLAKE2b-256 eeca033330fe35bb02d96c58e7550927536ffe5b3ff2439fdd27d5d6b807fc81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page