Skip to content

OptifySudarshanPatil/Modbus-RTU-IO-8CH-Tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modbus RTU IO 8CH Tester

A web-based utility for testing and controlling the Modbus RTU IO 8CH device through a serial connection. This application uses the Web Serial API to communicate directly with the device from a browser.

Features

  • Connect to Modbus RTU IO 8CH devices via serial port
  • Control individual output channels (ON/OFF/Toggle)
  • Control all channels simultaneously
  • Read input channel statuses
  • Auto-refresh capability for continuous monitoring
  • Command logging for debugging
  • Responsive design that works on desktop and mobile devices

Hardware Requirements

Usage

  1. Connect your Modbus RTU IO 8CH device to your computer via a USB to RS485 adapter
  2. Open the application in a supported browser
  3. Configure the connection settings (device address, baud rate, and parity)
  4. Click "Connect to Device"
  5. Use the interface to control outputs and monitor inputs

Browser Compatibility

This application uses the Web Serial API, which is currently supported in:

  • Google Chrome (version 89 or later)
  • Microsoft Edge (version 89 or later)
  • Opera (version 76 or later)

Firefox and Safari do not currently support the Web Serial API.

Technical Details

The application implements the Modbus RTU protocol as specified in the Waveshare documentation. It supports the following Modbus function codes:

  • 0x01: Read Coils (for reading output status)
  • 0x02: Read Discrete Inputs (for reading input status)
  • 0x05: Write Single Coil (for controlling outputs)

Development

This project uses vanilla JavaScript and does not require any build process. The Web Serial API is used for communication with the hardware device.

Project Structure

/
├── index.html        # Main HTML file
├── css/
│   └── styles.css    # Styling
└── js/
    ├── modbus.js     # Modbus RTU protocol implementation
    └── app.js        # Main application logic

Security Considerations

The Web Serial API requires user interaction before a page can connect to a device, and connections are only maintained while the page is open.

License

MIT License