A Windows Forms application for configuring and managing Bien-Air dental device controllers (DMX3 series) via RS-232 serial communication.
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.
- 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
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
Visual indicators show connection state:
- 🟢 Green: Device connected
- 🔴 Red: Device disconnected
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
- 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
- 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
- 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
- Clone the repository:
git clone https://github.com/yourusername/BienAir-DMX3.git
cd BienAir-DMX3- Open the solution in Visual Studio:
BienAir-DMX3.sln
- Restore dependencies and build:
msbuild BienAir-DMX3.csproj /p:Configuration=Release- The executable will be located in:
bin/Release/net40/BienAir-DMX3.exe
Before first use, ensure the data/ directory contains:
config.ini - Device configuration:
[nbHolder]
nb=3motor.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-
Connect to Device
- Click "Advanced..." to select COM port and baud rate
- Click "Connect" to establish connection
- Status indicator turns green when connected
-
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
-
View Device Information
- Navigate to "Drive Infos" tab
- View drive reference, serial number, and firmware version
- Check communication kit status
-
Advanced Parameters
- Navigate to "Parameters" tab
- Read/write EEPROM memory addresses
- Configure timeout values
- Set user data fields
- Change baud rate settings
-
Restore Defaults
- Use "Defaults" function to reset EEPROM to factory settings
- Warning: This will erase all custom configurations
When updating device settings, the application follows this sequence:
- Unprotect EEPROM
- Write configuration data
- Protect EEPROM
- Reset device
- Verify operation
- Refresh displayed data
- Baud Rates: 38400, 19200, 14400, 9600, 7200, 4800, 2400
- Data Bits: 8
- Parity: None
- Stop Bits: 1
- Timeout: 2000ms (read), 500ms (write)
[SOH][DATA...][CHECKSUM/CRC][EOT]
0x01 ... 0x04
Special characters are escaped:
- SOH (0x01) → ESC + 0xF0
- EOT (0x04) → ESC + 0xF1
- ESC (0x1B) → ESC + 0xF2
| 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 |
- Power Off Before Connecting: Ensure device is powered off before connecting/disconnecting serial cable
- Correct COM Port: Verify you're connecting to the correct serial port
- Backup Settings: Export/save current settings before making changes
- Firmware Updates: Do not interrupt power during firmware updates
- Motor Types: Only configure motor types compatible with your hardware
- COM Kit Restrictions: Some motor type modifications may be restricted based on COM kit version
"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
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
- 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
The project currently lacks automated unit tests. Recommended additions:
- Protocol frame encoding/decoding
- Checksum/CRC calculation
- Circular buffer operations
- Configuration file parsing
- 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
- New Command: Add method to
Protocol.cs, implement inProcessCom.cs - New UI Control: Create in
BienAir.Views.Controls/, integrate inMainWindows.cs - New Validation: Implement
DataFlowControlinterface, add to strategy selection - Configuration Option: Update INI files, modify
ConfigLoader.cs
# Debug build
msbuild BienAir-DMX3.csproj /p:Configuration=Debug
# Release build
msbuild BienAir-DMX3.csproj /p:Configuration=ReleaseEnsure data/ directory with configuration files is included in distribution.
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.
- Bien-Air Dental S.A. - Initial development and maintenance
- Bien-Air Dental S.A. for the DMX3 controller specifications
- Microsoft .NET Framework team
- Open-source community for design pattern references
For technical support or questions:
- Contact Bien-Air Dental S.A. technical support
- Refer to official DMX3 controller documentation
- Check troubleshooting section above
- Version: As specified in assembly info
- Framework: .NET 4.0
- Platform: Windows x86
- 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)
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.
.png)
.png)
.png)