Skip to main content

DrX protocol

Project description


DrX Works communication protocol

Latest Release pipeline status

This library is not intended to be used on its own. Instead each DrX works device has its own API library which uses this drx_protocol library as a dependency for the basic communication protocol.

Installation

Install the lastest python3 version. Open command line interface (cmd) and type pip3 install --upgrade drx-protocol

Usage example

See the manual of the DrX device for the full list of available commands for your device. However it is recommended to use the dedicated API libary of your device which already includes all commands.

import logging

from drx_protocol.protocol import drx_protocol, drx_command as cmd

# Set the debug level, normal operation: "INFO"
logging.basicConfig(level="DEBUG")

HOST = "192.168.1.100"
SERIAL = "fill in the serial number of the device"
ORGANIZATION = "fill in the organization from the software license provided with the device"
SIGNATURE = "fill in the signature from the software license provided with the device"

##########################################################################################################################################################
# Normal operation of the API
##########################################################################################################################################################

# constuct the API object
api = drx_protocol(
    host = HOST,
    serial = SERIAL,
    organization = ORGANIZATION,
    signature = SIGNATURE,
)

# send a single command to GET the frequency
cmd_freq = api.send_command(cmd("Frq"))
print(f"Frequency: {cmd_freq.value}")

# send a single command to SET the frequency
cmd_freq = api.send_command(cmd("Frq", "=", 2417.0))
print(f"Frequency: {cmd_freq.value}")

# send 5 commands in one message to GET all PSU voltages
response = api.send_command([cmd("V05"), cmd("V55"), cmd("V15"), cmd("Vm5"), cmd("V24")])
for val in response.values():
    print(f"{val.cmd}: {val.value}")

# Close the connection
api.close()

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

drx_protocol-1.0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

drx_protocol-1.0.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file drx_protocol-1.0.2.tar.gz.

File metadata

  • Download URL: drx_protocol-1.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for drx_protocol-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4496835a98d08823ad95b98cc45ca2c5bddc30430d73bc5cf88610a7c2b4ec0f
MD5 818a8ca5b9f9f1abeba2a4a90ea90240
BLAKE2b-256 5f75ac7ee722b125932ed083af1743dd82b05cf498af740f6d79ec4095972cc6

See more details on using hashes here.

File details

Details for the file drx_protocol-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: drx_protocol-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for drx_protocol-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b20daed7897ee8916f8003d4d6b8af76542cbd0fce0ab4a70d77641a4b2fcb7
MD5 92b5dba87eac30d1b8d24774b3a113ca
BLAKE2b-256 ec1e2087aa1c3a743629ffeb663c7ddbc38da23b3581c8bc43f00faeee4075b8

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