Skip to main content

Python library for connecting with Nextech force gauges over USB Serial

Project description

nexgraphpy module

Nexgraph Python

Description:

NexGraph Python is a Python library implementation of the NexGraph software which works with Nextech brand force gauges. It provides an easy way to connect to Nextech force gauges using Python. Despite it's name it does not create graphs as of yet, but does retrieve data from the device to be graphed.

This library is under development and more features will be added later.

Requirements:

Tested on Python versions 3.10+

Installation:

pip install nexgraphpy

Examples:

Import the library:

from nexgraph import NexGraph

Create a new instance:

dft_force_gauge = NexGraph()

Find and connect to a Nextech force gauge over USB serial port:

if dft_force_gauge.find():
    if dft_force_gauge.connect():
        print(dft_force_gauge.get_info())
        dft_force_gauge.disconnect()
        dft_force_gauge = None
    else:
        print("Unable to connect")
        exit()
else:
    print("No device found.")
    exit()

Connect to a Nextech force gauge directly:

# Initialize with device the path
dft_force_gauge = NexGraph("COM3")

# Or set the device path after initializing
dft_force_gauge.device_path = "COM3"

# Connect to device after setting the path
if dft_force_gauge.connect():
    ...

Basic device serial operations:

Returns boolean value

# Change device modes, peak and tracking
dft_force_gauge.mode()

# Change the units on device
dft_force_gauge.unit()

# Reset the current device value
dft_force_gauge.reset()

# Zero (Tare) the value on device
dft_force_gauge.zero()

Returns string value

# Download data from device memory
dft_force_gauge.download()

# Print current value
dft_force_gauge.print_value()

# Print peak compression value
dft_force_gauge.peak_compression()

# Print peak tension value
dft_force_gauge.peak_tension()

# Print different formatted outputs
dft_force_gauge.long_output()
dft_force_gauge.short_output()
dft_force_gauge.mini_output()

Output live data of 100 rows:

Note: The output rate is roughly 10 data points per second. 100 data points is approximately 10 seconds of testing.

i = 0
while True:
    print(dft_force_gauge.long_output())
    i += 1
    if i >= 100:
        break

Documentation

Nexgraph Python Docs https://python.nexgraphapp.com/

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

nexgraphpy-1.0.3.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

nexgraphpy-1.0.3-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file nexgraphpy-1.0.3.tar.gz.

File metadata

  • Download URL: nexgraphpy-1.0.3.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for nexgraphpy-1.0.3.tar.gz
Algorithm Hash digest
SHA256 af2a9da0b153127bd79ea56f4dfd26e2c5faa73d2278dd1e084c3f2e57b32391
MD5 6214bc2b4311b72e4833bbdcdfcda4ef
BLAKE2b-256 41710808dee94a8a9508cfe62ca02c6bc3a12e1a78c71a201a75623bf6673b2f

See more details on using hashes here.

File details

Details for the file nexgraphpy-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: nexgraphpy-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for nexgraphpy-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b9d3938ee3dcc0bf402cfafac04347dde2447a15a207852aa61cc8d60938dc6d
MD5 2c174590c79e0328177f34e7b78998ca
BLAKE2b-256 fabd113f8aec350640b47922d3b1cdddb4abcb1f2e7f60d752a388064bb12d05

See more details on using hashes here.

Supported by

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