Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BienAir DMX3 Configurator

Platform .NET Language License

A Windows Forms application for configuring and managing Bien-Air dental device controllers (DMX3 series) via RS-232 serial communication.

📋 Overview

BienAir DMX3 Configurator is a specialized desktop application designed to configure, monitor, and update Bien-Air dental equipment controllers. It provides a graphical interface for managing motor configurations, drive parameters, and device settings through serial communication.

Key Features

  • Motor & Holder Configuration: Configure up to 3 motor holders with customizable settings
  • Real-time Device Monitoring: View drive information, serial numbers, and firmware versions
  • EEPROM Management: Read/write EEPROM data, restore defaults, and manage protection states
  • Serial Communication: Support for multiple baud rates (2400-38400) with automatic detection
  • Data Integrity: Checksum and CRC validation for reliable communication
  • Advanced Settings: Configure timeouts, user data, and baud rate settings

🖥️ Screenshots

Main Interface

The application features a tabbed interface with three main sections:

  • Motors & Holders: Configure motor types and activation states
  • Parameters: Advanced EEPROM and timeout settings
  • Drive Infos: View device information and status

Connection Status

Visual indicators show connection state:

  • 🟢 Green: Device connected
  • 🔴 Red: Device disconnected

🏗️ Architecture

The application follows a modular architecture with clear separation of concerns:

BienAir/
├── BienAir.Models.Com/          # Communication layer
│   ├── RS232Com.cs             # Serial port management (Singleton)
│   ├── Protocol.cs             # DMX3 protocol implementation
│   ├── DataFlowControl.cs      # Abstract data validation
│   ├── Checksum.cs             # Checksum validation
│   └── CRC.cs                  # CRC validation
├── BienAir.Models.Job/          # Business logic
│   └── ProcessCom.cs           # Command processing & coordination
├── BienAir.Models.Data/         # Data management
│   ├── CircularBuffer.cs       # Ring buffer for serial data
│   └── ConfigLoader.cs         # INI file configuration loader
├── BienAir.Models.Pattern/      # Design patterns
│   ├── Observer.cs             # Observer pattern interface
│   └── Subject.cs              # Subject pattern interface
├── BienAir.Views.Forms/         # UI forms
│   ├── MainWindows.cs          # Main application window
│   ├── Disclaimer.cs           # Legal disclaimer dialog
│   ├── AboutForm.cs            # About dialog
│   ├── RSSetup.cs              # Serial port configuration
│   └── MessageBoxForm.cs       # Custom message boxes
├── BienAir.Views.Controls/      # Custom controls
│   ├── MotorControl.cs         # Motor configuration panel
│   ├── DriveInfosControl.cs    # Drive information display
│   └── MemParameters.cs        # Memory parameter editor
├── BienAir.Tools/               # Utilities
│   └── IniParser.cs            # INI file parser
└── Properties/                  # Application properties

Design Patterns Used

  • Observer Pattern: For handling serial communication events and UI updates
  • Singleton Pattern: RS232Com ensures single instance of serial port
  • Strategy Pattern: DataFlowControl allows switching between Checksum/CRC validation

🔧 Technology Stack

  • Framework: .NET Framework 4.0
  • UI: Windows Forms
  • Language: C# 11.0
  • Platform: Windows (x86)
  • Communication: System.IO.Ports (RS-232)
  • Build System: MSBuild / Visual Studio

📦 Installation

Prerequisites

  • Windows 7 or later (x86 or x64)
  • .NET Framework 4.0 or later
  • RS-232 serial port or USB-to-Serial adapter
  • Bien-Air DMX3 controller device

Build from Source

  1. Clone the repository:
git clone https://github.com/yourusername/BienAir-DMX3.git
cd BienAir-DMX3
  1. Open the solution in Visual Studio:
BienAir-DMX3.sln
  1. Restore dependencies and build:
msbuild BienAir-DMX3.csproj /p:Configuration=Release
  1. The executable will be located in:
bin/Release/net40/BienAir-DMX3.exe

Configuration Files

Before first use, ensure the data/ directory contains:

config.ini - Device configuration:

[nbHolder]
nb=3

motor.ini - Motor type definitions:

[nbType]
nb=5

[motor]
m1=Motor Type 1
m2=Motor Type 2
m3=Motor Type 3
m4=Motor Type 4
m5=Motor Type 5

🚀 Usage

Basic Operations

  1. Connect to Device

    • Click "Advanced..." to select COM port and baud rate
    • Click "Connect" to establish connection
    • Status indicator turns green when connected
  2. Configure Motors

    • Navigate to "Motors & holders" tab
    • Select motor type for each holder (1-3)
    • Configure switch states (normally open/closed)
    • Check/uncheck activation boxes
    • Click "Update" to save changes
  3. View Device Information

    • Navigate to "Drive Infos" tab
    • View drive reference, serial number, and firmware version
    • Check communication kit status
  4. Advanced Parameters

    • Navigate to "Parameters" tab
    • Read/write EEPROM memory addresses
    • Configure timeout values
    • Set user data fields
    • Change baud rate settings
  5. Restore Defaults

    • Use "Defaults" function to reset EEPROM to factory settings
    • Warning: This will erase all custom configurations

Command Flow

When updating device settings, the application follows this sequence:

  1. Unprotect EEPROM
  2. Write configuration data
  3. Protect EEPROM
  4. Reset device
  5. Verify operation
  6. Refresh displayed data

📡 Communication Protocol

Serial Port Settings

  • Baud Rates: 38400, 19200, 14400, 9600, 7200, 4800, 2400
  • Data Bits: 8
  • Parity: None
  • Stop Bits: 1
  • Timeout: 2000ms (read), 500ms (write)

Frame Structure

[SOH][DATA...][CHECKSUM/CRC][EOT]
 0x01          ...         0x04

Special characters are escaped:

  • SOH (0x01) → ESC + 0xF0
  • EOT (0x04) → ESC + 0xF1
  • ESC (0x1B) → ESC + 0xF2

Supported Commands

Command Code Description
Read Holder 0xF6 Read motor holder configuration
Write Holder 0xF5 Write motor holder configuration
Read Switch 0xF6 (addr 0x40) Read switch states
Write Switch 0xF5 (addr 0x40) Write switch states
Read Drive Ref 0x10 Read drive reference code
Read Config 0xFC Read configuration kit
Read Serial No 0x12 Read device serial number
Read Version 0x11 Read firmware version
Unprotect EEPROM 0xF0 0x01 Disable EEPROM write protection
Protect EEPROM 0xF0 0x00 Enable EEPROM write protection
Default EEPROM 0xF1 Restore factory defaults
Reset Device "RESET" Soft reset the controller
Read Timeout 0xF4 Read timeout value
Write Timeout 0xF3 Write timeout value
Read User Data 0x13 Read user data area
Write User Data 0xF7 Write user data area
Write Baud Rate 0xF2 Change communication baud rate

⚠️ Safety Warnings

  1. Power Off Before Connecting: Ensure device is powered off before connecting/disconnecting serial cable
  2. Correct COM Port: Verify you're connecting to the correct serial port
  3. Backup Settings: Export/save current settings before making changes
  4. Firmware Updates: Do not interrupt power during firmware updates
  5. Motor Types: Only configure motor types compatible with your hardware
  6. COM Kit Restrictions: Some motor type modifications may be restricted based on COM kit version

🔍 Troubleshooting

Common Issues

"No Serial port available"

  • Ensure RS-232 cable or USB-to-Serial adapter is properly connected
  • Install necessary drivers for USB-to-Serial converter
  • Check Device Manager for COM port assignment

"Serial port already in use"

  • Close any other applications using the COM port
  • Restart the application
  • Try a different COM port

"RS-232 Error"

  • Verify baud rate matches device configuration
  • Check cable connections
  • Ensure device is powered on
  • Try lower baud rates for longer cables

"Drive not connected"

  • Click "Connect" button first
  • Check physical connections
  • Verify COM port settings in "Advanced" dialog

"Data saving error"

  • Ensure EEPROM is unlocked (automatic)
  • Check device power stability
  • Try restoring defaults and reconfiguring

Debug Mode

Enable console output for debugging:

// In Program.cs, uncomment AllocConsole() call
AllocConsole();

Console will display:

  • Sent/received byte sequences
  • Connection status messages
  • Error details
  • Protocol parsing information

🧪 Testing

Manual Testing Checklist

  • Connect to device successfully
  • Read all holder configurations
  • Modify and save holder settings
  • Read drive information (serial, version)
  • Test disconnect/reconnect cycle
  • Verify checksum/CRC validation
  • Test timeout handling
  • Restore default settings
  • Test all baud rates

Unit Testing

The project currently lacks automated unit tests. Recommended additions:

  • Protocol frame encoding/decoding
  • Checksum/CRC calculation
  • Circular buffer operations
  • Configuration file parsing

📝 Development

Code Style

  • Follow C# naming conventions (PascalCase for public members, camelCase for private)
  • Use regions to organize large files
  • Add XML documentation comments for public APIs
  • Keep methods focused and under 100 lines when possible

Adding New Features

  1. New Command: Add method to Protocol.cs, implement in ProcessCom.cs
  2. New UI Control: Create in BienAir.Views.Controls/, integrate in MainWindows.cs
  3. New Validation: Implement DataFlowControl interface, add to strategy selection
  4. Configuration Option: Update INI files, modify ConfigLoader.cs

Building Releases

# Debug build
msbuild BienAir-DMX3.csproj /p:Configuration=Debug

# Release build
msbuild BienAir-DMX3.csproj /p:Configuration=Release

Ensure data/ directory with configuration files is included in distribution.

📄 License

This software is proprietary and copyright © Bien-Air Dental S.A 2014.

All rights reserved. Unauthorized copying, modification, distribution, or use of this software is strictly prohibited.

👥 Authors

  • Bien-Air Dental S.A. - Initial development and maintenance

🙏 Acknowledgments

  • Bien-Air Dental S.A. for the DMX3 controller specifications
  • Microsoft .NET Framework team
  • Open-source community for design pattern references

📞 Support

For technical support or questions:

  • Contact Bien-Air Dental S.A. technical support
  • Refer to official DMX3 controller documentation
  • Check troubleshooting section above

🔄 Version History

Current Version

  • Version: As specified in assembly info
  • Framework: .NET 4.0
  • Platform: Windows x86

Known Limitations

  • Windows-only (no cross-platform support)
  • Limited to 3 motor holders
  • Requires physical RS-232 connection (no network support)
  • No automated backup/restore functionality
  • Configuration files use simple INI format (no schema validation)

🛣️ Roadmap

Potential future enhancements:

  • Cross-platform support (.NET Core/MAUI)
  • Automated configuration backup/restore
  • Batch configuration for multiple devices
  • Real-time motor status monitoring
  • Graphical motor position visualization
  • Configuration import/export (JSON/XML)
  • Automated testing suite
  • Network communication support (TCP/IP)
  • Multi-language UI support
  • Enhanced error logging and diagnostics

Disclaimer: This software is provided for authorized users only. Misuse may damage equipment or void warranties. Always follow manufacturer guidelines and safety procedures when operating dental equipment.

About

BienAir DMX3 配置工具是一款专用的桌面应用程序,用于配置、监控和更新 Bien-Air 牙科设备控制器。它提供了图形化界面,通过串行通信管理电机配置、驱动器参数和设备设置。

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages