Skip to main content

Biblioteca Python para decodificar o protocolo de comunicação serial do multímetro VICTOR 86C/86D.

Project description

VICTOR 86C/86D Multimeter Parser

A Python library for parsing and decoding the serial data stream from VICTOR 86C and VICTOR 86D digital multimeters (DMM).

This library was developed through reverse engineering of the 14-byte data packets sent by the multimeter's USB/Serial interface, enabling developers to easily integrate the multimeter into Python applications for data logging, automation, and monitoring.

🚀 Features

  • Real-time Decoding: Parses raw 14-byte hex packets into readable floating-point values.
  • Unit & Mode Detection: Automatically detects measurement units (V, A, Ohm, Hz, etc.) and modes (AC, DC, HOLD, MAX/MIN).
  • Symbol Support: Identifies special symbols like AUTO, DIODE, BEEP, and prefixes (m, u, k, M).
  • Bargraph Data: Extracts the analog bargraph value (0-42).
  • Lightweight: Pure Python implementation with no heavy dependencies.

📦 Installation

To install the library locally, navigate to the project directory (where setup.py is located) and run:

pip install victor86c_parser

🛠️ Usage

Basic Usage

You can easily decode a raw packet and get the final measurement value and unit string.

from victor86c_parser import Victor86cParser

# Example raw packet (14 bytes) received from serial
# Represents: 0.017 A (DC)
raw_packet = b'+0017 \\x001\\x00\\x00@\\x00'

# Create a parser instance
parser = Victor86cParser(raw_packet)

# Get the decoded value
value = parser.get_measurement_value()
unit = parser.get_unit_string()
mode = parser.get_mode()

print(f"Reading: {value} {unit} ({mode})")
# Output: Reading: 0.017 A (DC)

Serial Monitor Example

Here is a simple example of how to read from the serial port and decode data in real-time using pyserial.

import serial
from victor86c_parser import Victor86cParser

# Configure your serial port (Windows: 'COMx', Linux: '/dev/ttyUSBx')
PORT = 'COM11'
BAUD = 2400

ser = serial.Serial(PORT, BAUD, timeout=0.5)

print(f"Listening on {PORT}...")

try:
    while True:
        # Read a full line (14 bytes data + 2 bytes CR/LF)
        line = ser.readline()
        
        # Extract the 14 data bytes (ignore CR/LF)
        if len(line) >= 14:
            data_packet = line[:14]
            
            parser = Victor86cParser(data_packet)
            
            val = parser.get_measurement_value()
            unit = parser.get_unit_string()
            mode = parser.get_mode()
            
            print(f"Measured: {val} {unit} ({mode})")

except KeyboardInterrupt:
    print("Stopped.")
    ser.close()

📚 Protocol Documentation

The VICTOR 86C sends a 14-byte packet followed by \\r\\n (CRLF) continuously (approx. 2-3 times/sec).

Byte Index Bit Description Example Values (Hex Bitmasks)
0 0 Sign (+/-) +, - (ASCII)
1-4 1-4 Numeric Digits 0-9 (ASCII)
5 5 Space/Separator (ASCII Space)
6 6 Decimal Point 1 (/1000), 2 (/100), 4 (/10) (ASCII)
7 7 Mode Bitmask 0x20 (AUTO), 0x10 (DC), 0x08 (AC), 0x04 (REL), 0x02 (HOLD)
8 8 MAX/MIN Bitmask 0x20 (MAX), 0x10 (MIN)
9 9 Prefix Bitmask 0x80 (µ), 0x40 (m), 0x20 (k), 0x10 (M), 0x08 (Beep), 0x04 (Diode), 0x01 (None/Nano*)
10 10 Unit Bitmask 0x80 (V), 0x40 (A), 0x20 (Ω), 0x10 (hFE), 0x08 (Hz), 0x04 (F), 0x02 (°C), 0x01 (°F), 0x00 (%)
11 11 Analog Bargraph Integer value (0-42)
12-13 - Terminators \r\n

🤝 Contributing

Contributions are welcome! If you have a VICTOR 86C/86D and find a symbol or mode that isn't mapped correctly, please open an issue or submit a pull request with the raw hex data and the expected display value.

📄 License

This project is licensed under the MIT License.

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

victor86c_parser-1.0.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

victor86c_parser-1.0.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: victor86c_parser-1.0.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for victor86c_parser-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fc13634aedf4e5b03dd8c47a21975cb8ce3aed07e7bb86294ea94e39b5af9fcc
MD5 d1cd19c81ae8db9e474eea2cb50b9a71
BLAKE2b-256 195c8dc5f33334254d9218cabd1cf36e76c82de587fb65a34b0a3e68f1c30ccb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for victor86c_parser-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0babbc50792f69059cfc4469b19821e1bc262a197364af1dd819aedac9e273c
MD5 9c2e67b19c3f0723d97912eb80a0bdf8
BLAKE2b-256 7faea30a1a6a1addc0021c04d5c7c23d1b7a1061b27cffe2fba3811bb76be845

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