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
0 0 Sign (+/-) +, -
1-4 1-4 Numeric Digits 0017 (ASCII)
5 5 Space/Separator (Space)
6 6 Decimal Point 1 (/1000), 2 (/100), 4 (/10)
7 7 Measurement Mode 1 (DC), ) (AC), ! (AUTO), # (AUTO HOLD)
8 8 MAX/MIN Indicator \\x20 (MAX), \\x10 (MIN)
9 9 Prefix/Symbol \\x10 (M), @ (m), \\x80 (u), \\x01 (k)
10 10 Base Unit 2 (C), 1 (F), @ (A), \\x80 (V), (Ohms)
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.1.tar.gz (5.6 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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: victor86c_parser-1.0.1.tar.gz
  • Upload date:
  • Size: 5.6 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.1.tar.gz
Algorithm Hash digest
SHA256 405aab71e3ddd4f8d67c8e39332e4078c8701a456f71337ff9651e84d8e53826
MD5 b9da5e2a912190ab57f196e892b68b2a
BLAKE2b-256 4022ba43b3db001d1ac2171f3c28667c63b3705ab93ea2e4efa2a77e347a1acb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for victor86c_parser-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4230be6f0b3d22b12d0351fe4a9a94fcd49ffb0a2bc88ec6d2cf8371b9b0706
MD5 113b70c298789d0e58c97fc035ea4682
BLAKE2b-256 9deed25d89a2421be777aaa51dd8b8cfba06e6683267d4639ca1f14afad1a4b3

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