If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.
Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.
Modbus connection characteristics:
Default Modbus settings: 9600 baud, 8N1, RTU communication, slave ID: 1
Function Code: 06/16 control, 03 read status
| Address | Function | R/W |
|---|---|---|
| 0 | ASCII code The 1st digit tube displays the contents | R/W |
| 1 | ASCII code The 2nd digit tube displays the contents | R/W |
| 2 | ASCII code The 3st digit tube displays the contents | R/W |
| 3 | ASCII code The 4st digit tube displays the contents | R/W |
| 4 | ASCII code The 5st digit tube displays the contents | R/W |
| 5 | ASCII code The 6st digit tube displays the contents | R/W |
| 6 | Used in combination with register 7 (0xFFFFFFFF), cannot be used alone. High 4 bits of the high byte (0xFFFFFFFF): 0 indicates a positive number, 1 indicates a negative number Lower 4 bits of the high byte (0xFFFFFFFF): specify the number of decimal places, ranging from 0 to 5 Together with register 7, they specify the data to be displayed 0xFFFFFFFF) (for data above 65535, three bytes are needed; this byte indicates the highest 8 bits of the data. Note: This register should be used together with register 7. To write data to these two registers, use the write multiple holding register (16 function code) when displaying data. | R/W |
| 7 | Display data. Can be used in combination with register 6 (0xFFFFFFFF), or separately. (1) Together with register 6, this register indicates the data to be displayed (the data is represented by 3 bytes, 0xFFFFFFFF), the high byte of this register indicates the middle 8 bits of the data (0xFFFFFF), and the low byte indicates the lowest 8 bits of the data (0xFFFFFF). The high byte comes first and the low byte comes second. (0xFFFF) Note: This register is used in conjunction with register 6 to write data to these two registers using the Write Multiple Holding Register (16 function code) when displaying data. (2) When used independently, write a hexadecimal number into the register, and the digital tube will be converted into a decimal number for display. | R/W |
| 8 | Blink control register. Each bit represents one digital tube; the lowest bit represents the first digital tube, and so on. 0: no blinking (default), 1: Blinking Note: This parameter is not saved when power is lost. | R/W |
| 9 | Digital tube brightness level, 1..8, 6 digits default 4, 4 digits default 8. Note: This parameter is saved upon powering down. | R/W |
| 10 | Display content is saved. 0: No saving (default), 1: Save all digital tube display content Note: this parameter is saved when powered off. | R/W |
| 11 | Digital tube power-on initial display mode setting. 0: Display “0”; (default), 1: Display the RS485 address of the module, 2: Display of saved data. Note: This parameter is saved at power down. | R/W |
| 251 | 00: Restore factory settings Telegram: FF 06 00 FB 00 00 ED E5 | R/W |
| 252 | Data return delay: 0..25 (* 40 ms); Return data interval time after receiving the command (unit 40 ms) | R/W |
| 253 | RS485 Address / Slave Address: 1..247, default: 1 | R/W |
| 254 | Baud rate: 0..255; 0:1200, 1:2400 2:4800, 3:9600(default), 4:19200, 5:38400, 6:57600, 7:115200, Other: Restore factory settings | R/W |
| 255 | Parity bit: 0..2; 0 :None(default), 1: Even Parity, 2: Odd Parity | R/W |
To use these displays with an Arduino, you need an RS-485 to TTL converter module (like a MAX485 module) to translate the signals. You'll also use the Modbus library to send commands.
Connect the components as follows, using the Arduino's hardware serial pins (Pin 0/RX and Pin 1/TX):
| Converter Pin | Arduino Pin | Display Pin | Description |
|---|---|---|---|
| VCC | 5V | VCC | Power for converter (use external supply for display) |
| GND | GND | GND | Ground |
| RO | Pin 0 (RX) | N/A | Receiver Output |
| DI | Pin 1 (TX) | N/A | Driver Input |
| RE & DE | Pin 2 | N/A | Receiver/Driver Enable (bridge and connect to one pin) |
| A | N/A | A (RS485A) | RS-485 Differential Signal + |
| B | N/A | B (RS485B) | RS-485 Differential Signal - |
Note: The RE and DE pins on the MAX485 module should be connected together and wired to a single digital pin (e.g., Pin 2) to control data direction (send/receive).
Install the ModbusMaster library by Doc Walker through the Arduino IDE Library Manager. This library simplifies Modbus RTU communication.
This code uses the ModbusMaster library to send a simple “display value” command (Function Code 6) to the display's default address (0x01).
#include <ModbusMaster.h> // Initialize ModbusMaster instance // Use Hardware Serial on pins 0 (RX) and 1 (TX) ModbusMaster node; #define DE_RE_PIN 2 // Pin to control RS-485 direction void setup() { Serial.begin(9600); // Start serial communication node.begin(1, Serial); // Slave ID 1, use the standard Serial port // Set the direction control pin pinMode(DE_RE_PIN, OUTPUT); node.setTransmitBuffer(DE_RE_PIN); // Tell the library which pin controls direction } void loop() { static uint16_t value_to_display = 0; uint8_t result; // Send Modbus command to display the value // Function 0x06 (Write Single Register) // Address 0x0000 (usually the register for the main value) // Value to display result = node.writeSingleRegister(0x0000, value_to_display); if (result == node.ku8MBSuccess) { // Command sent successfully value_to_display++; if (value_to_display > 9999) { // Adjust max value based on 4 or 6 digits value_to_display = 0; } } else { // Handle communication error (optional) // Serial.print("Error: "); // Serial.println(result); } delay(1000); // Update every second }
This page has been accessed for: Today: 2, Until now: 13