Actions

MD12002 RS485 to Ethernet DIN Rail Converter (EN)

From Modig.pl Wiki

Description

Industrial RS485 to Ethernet Bus Converter for DIN Rail Mounting
The MODIG RS485-ETHERNET DIN is a versatile and user-friendly bus converter that bridges an RS485 serial network with an Ethernet network interface. The device is specifically engineered for mounting on a standard 35 mm DIN electrical installation rail (TH35). Thanks to its ultra-slim and compact design, the module has a physical width of just 35 mm, allowing it to fit easily into tightly packed industrial switchboards or small distribution cabinets. An integrated USB auxiliary interface simplifies maintenance and parameter configuration.




Key Features and Specifications

  • RS485 Interface: Terminals: A+, B-, GND, and TERM via Phoenix Contact MC 3.81 mm connector
  • Termination Resistor: Integrated 120 Ω bus terminator (configurable)
  • RS485 Circuit Protection: 1 kV galvanic isolation and integrated surge protection
  • RS485 Baud Rate: Supports any custom value from 200 bps to 1,000,000 bps (1 Mbps)
  • RS485 Serial Parameters: Data bits: 7/8; Parity: None/Even/Odd; Stop bits: 1/1.5/2; Half-Duplex
  • Network Capacity: Supports up to 64 nodes on the RS485 bus
  • Buffer Size: Maximum RS485 data frame length of 4 kB (4096 bytes)
  • Network Interface: RJ45 port, 10/100 Mbps Base-T Full Duplex Ethernet
  • Network Addressing: Configurable MAC address; IPv4 support with Static IP or DHCP assignment
  • Operational Modes: TCP Server, TCP Client, Concurrent UDP, and UDP Broadcast
  • Device Configuration: Password-protected, built-in Web-UI (HTTP)
  • Diagnostics: Operational status readout via USB or Web-UI
  • DC Power Input: Supports a steady external DC voltage range of 7–38 V DC (min. 0.2 A)
  • Auxiliary Power Input: Optional power delivery via an integrated USB-C connector
  • Form Factor: Rugged enclosure designed for standard DIN 35 (TH 35) rail installation; Dimensions: 90 x 35 x 65 mm
  • Operating Temperature Range: -20°C to +50°C
  • Status Indicators: Diagnostic LEDs
  • Firmware Upgrade: Supported via USB interface



Applications

The MODIG RS485-ETHERNET DIN converter enables bidirectional data routing between an RS485 serial bus and an Ethernet network. Communication can be established transparently between two MODIG RS485-ETHERNET DIN modules or integrated with any third-party field device supporting standard TCP and/or UDP protocols.

Serial data frames from the RS485 bus are packed and converted into Ethernet TCP/UDP packets. For large payloads (exceeding 1.5 kB up to the 4 kB maximum), an internal fragmentation mechanism splits the payload into smaller network frames. At the receiving destination node, the original RS485 data format is fully reconstructed, ensuring completely transparent communication across the network layer.

Typical application layout for the MODIG RS485-ETHERNET DIN converter:


RS485 Interface

The physical RS485 interface is accessible via a 4-pin Phoenix Contact MC 3.81 mm screw terminal block.

Pin Number Label Function
1 T Activates the internal 120 Ω line termination resistor. The resistor is engaged when terminal T is shorted to terminal A+.
2 A+ RS485 differential line A (Non-inverting / Positive potential)
3 B- RS485 differential line B (Inverting / Negative potential)
4 Signal Ground (GND) for the RS485 bus

The MODIG converter can be connected to an RS485 bus containing up to 64 devices (including the converter itself). Devices must be daisy-chained to avoid stub lines or bus branches; any necessary drop lines must be kept as short as possible. 120 Ω impedance matching termination resistors should be placed at both physical ends of the bus line. The MODIG converter includes an on-board termination resistor, which can be enabled by bridging terminal A+ and terminal T.

The diagram below shows a simplified wiring schematic of the RS485 bus network, terminated with a standard 120 Ω resistor on one end, and the converter's internal termination on the other. It also illustrates the correct daisy-chain connection method versus incorrect topology.



ETHERNET Interface

The MODIG converter features a 10/100 Mbps Ethernet port utilizing a standard RJ45 connector interface labeled ETHERNET. This allows the converter to join a Local Area Network (LAN). The LNK LED indicates a valid physical network connection, while a flashing ACT LED signals active data traffic over the Ethernet network layer.



DC Power Supply

Primary power to the MODIG converter is delivered by applying a steady DC voltage to the terminal block labeled DC 7-38V. This is a 2-pin Phoenix Contact MC 3.81 mm screw terminal interface. The external power source must deliver a voltage within the range of 7 to 38 V DC with a minimum current capacity of 0.2 A. Strict attention must be paid to ensuring the correct wiring polarity.


Alternatively, auxiliary power can be delivered to the module via the USB-C port labeled USB. The external source must deliver 5 V DC ±10% with a minimum capacity of 0.2 A. This requirement is met by standard USB chargers, PC interface ports, or Single Board Computers (SBCs).



Status LED Indicators

The operation of the MODIG RS485-ETHERNET DIN converter is monitored using 3 diagnostic LEDs.

LED Indicator Status Meaning
STA (green) Blinking at a steady interval indicates the system logic is correctly powered, regardless of the active power source. A solid green light indicates a valid Ethernet network link and a successfully leased IP address.
ETH (blue) Blinking indicates active transmission or reception of TCP/UDP packets. A solid blue light indicates an active, established TCP Server-Client connection.
RS (red) Blinking signals data transmission (TX) or reception (RX) activity on the RS485 serial bus.



RES Function Button

The hardware function button allows the user to trigger a full system reboot or perform a complete factory reset. To actuate the button, gently insert the end of a paperclip into the small pinhole labeled RES until a tactile click is felt.

A system reboot is triggered on an active device by holding the RES button down for approximately 5 seconds and then releasing it. During this action, the red RS LED will flash 4 times shortly followed by a single long illumination lasting 1 second. The button must be released during this long 1-second flash. The MODIG converter will then perform a clean hardware system restart.

A factory reset is executed on an active device by holding the RES button down for approximately 10 seconds before releasing it. This sequence triggers 4 short red flashes on the RS LED, a 1-second long flash, a 4-second delay, and finally a second long illumination. The button must be released during this second long flash. This action purges all custom configurations (wiping network setups, serial parameters, Web-UI access passwords, etc.) and restores the converter to its factory defaults.



USB Diagnostics Interface

The USB-C interface port labeled USB serves as an auxiliary power input and doubles as a diagnostic bridge to track real-time runtime parameters. Connecting the converter to a PC registers a Virtual COM Port inside the host operating system (e.g., listed as COM5).


Any standard serial terminal emulation software (e.g., PuTTY, BrayTerminal, etc.) can be opened to listen on the allocated Virtual COM Port. The communication channel profile must be configured to: 115200 bps, 8 data bits, No parity, 1 stop bit (115200, 8, N, 1). The terminal window will stream active diagnostic readouts from the MODIG converter:

This feed provides a quick method to check the leased IP address assigned to the converter, along with critical parameters including DHCP lease status, MAC address, and active TCP/UDP socket configurations.


Device Firmware Upgrade (Firmware Update)

Flashing a new firmware version requires a desktop PC equipped with the official STM32Cube Programmer application, an available USB port, and a standard USB-A to USB-C link cable.


The STM32Cube Programmer application can be obtained from the official STMicroelectronics portal: https://www.st.com/en/development-tools/stm32cubeprog.html
Select the appropriate installer for your desktop operating system, run the installation package, and follow the setup wizard.

To put the MODIG converter into Device Firmware Upgrade (DFU) mode, follow these steps:

  1. Disconnect the converter from the Ethernet network, the RS485 bus lines, and its external power source.
  2. While the device is fully unpowered, press and hold down the hardware RES button using a paperclip.
  3. Keeping the RES button compressed, connect the USB cable from the PC to the USB-C port labeled USB on the MODIG converter.


The status LEDs will remain completely dark, confirming that the internal bootloader has entered DFU mode. The host PC device manager will list a new hardware entry:


Launch the STM32Cube Programmer software, change the interface connection type to USB, and click Connect.


Click on Open file, browse to the directory containing the compiled firmware binary (e.g., Modig_3_0.elf), select it, and click Download. A confirmation dialog will pop up upon completion; click OK.


Finally, click Disconnect within the utility and unplug the USB cable from the converter. Reconnecting the USB cable normally (without pressing the RES button) will cycle the power, and the MODIG converter will initialize running the newly flashed firmware stack.


Converter Configuration

All hardware and communication parameters of the MODIG converter are managed using the embedded web configuration engine.
Open a web browser on a PC or smartphone connected to the same Local Area Network (LAN) as the MODIG module, and type the device's current IP address into the address bar. The active IP address can be found using the live serial diagnostic stream over USB (see the “USB Diagnostics Interface” section) or via the network router's DHCP lease table.


User Authentication (Login)

Navigating to the correct IP address brings up the MODIG Web-UI dashboard challenge screen. Accessing the configuration backend requires entering the security password; the factory default value is “1234”.


Entering an invalid password will display an authentication failure alert.



Main Menu Dashboard

A successful login session opens the core configuration panel. The bottom area of the layout displays foundational device info and real-time operational variables.


Once modifications to the operating parameters are complete, terminate the session by clicking the LOGOUT button. This explicit action writes the updated parameters into the device's non-volatile EEPROM configuration storage block.

If a user fails to log out manually, the active Web-UI session will time out automatically after 5 minutes of inactivity. Any uncommitted parameter adjustments are saved to the non-volatile memory block after 1 minute of inactivity on the configuration portal.


Device Management Profile (DEVICE)

Device Name — A custom string identifier defined by the user to label the hardware unit. To change this value, input the string into the text box adjacent to the Device Name field and commit the modification by clicking the Apply button below.

Access Password Management
The configuration portal is locked behind a password challenge. Authentication is bound to the requesting client's IP address and remains valid for a sliding window of 5 minutes. The countdown resets with each action taken within the Web-UI; 5 minutes of total idle time drops the token and forces an automatic session logout.

To provision a new access token, input the desired value into the New Password and Repeat new password text boxes, then commit the change using the corresponding Apply button.


A successful write update will show the following success confirmation message:



Network Parameter Configuration (NETWORK)

The networking section handles the low-level identity profiles, including the hardware address (Device MAC) and the IP block topology. When the network automation flag is set to DHCP - ENABLE, the MODIG converter requests an operational IP setup from the local network gateway or DHCP server. Conversely, flipping this setting to DISABLE switches the stack over to static configurations, requiring manual entries for the target IP address (Device static IP) and the corresponding subnet mask (Subnet mask).


Modifying the hardware MAC address requires a hard system reboot to reinitialize the network controller chip; this can be done by clicking the RESTART button. Updating static IP variables requires recycling the Ethernet interface stack, which can be done by clicking the RECONNECT button.

Executing either operation terminates the active browser session, logs the user out, and restarts the physical Ethernet interface. Depending on the newly committed settings, the web management panel will map onto a different network endpoint address.


Network Operational Profile (MODE)

The MODIG converter routes data payloads across the IP network using independent TCP and UDP protocol engines running concurrently.

The TCP engine operates under a strict Server-Client model, requiring a destination IP pointer indicating where serial payloads should be forwarded, paired with a target socket port number constrained within the user range of 1024 to 65535.

The UDP engine functions without maintaining fixed sessions or connection states. It requires a target destination IP pointer along with an unprivileged port assignment within the 1024 to 65535 range. Setting the destination address to the broadcast IP 255.255.255.255 switches the socket engine over to broad-network transmission (broadcasting), mirroring serial payloads to every active listening node on the local subnet.



Serial Interface Tuning (RS485)

The adjustable physical parameters governing the integrated RS485 UART serial interface include:

  • Communication Speed (Baudrate): Supports values from 200 bps up to 1,000,000 bps (1 Mbps)
  • Serial Frame Size (Data bits): Configurable to 7 or 8 bits
  • Bit Parity Verification (Parity): None, Even, or Odd
  • Serial Framing End-Marker (Stop bits): 1, 1.5, or 2 bits

The UART parameters configured inside the MODIG converter must match the serial properties of all peripheral target nodes attached to the RS485 line. Save new variables using the Apply button below the menu fields.

Data payloads routed over the physical RS485 bus are formatted into packets (frames), capped by an end-of-packet character sequence or a designated duration of line quietness. The converter packages serial data streams and drops them onto the network stack as unified blocks; frames missing proper completion markers are held in the serial buffer and will not pass onto the network layer.

The MODIG engine can monitor for frame completion by parsing for a programmable sequence of 1 to 4 characters (e.g., the keyword string “END”, a series of byte markers like “0xFF 0xFF 0xFF 0xFF”, or standard text line-end delimiters like CR LF — Carriage Return, Line Feed). The parsing sequence must be formatted as hexadecimal notation values corresponding to the standard ASCII map, prefixed by an 'x' identifier; for example, the string “END” must be input as “x45 x4E x44”. Leaving this field empty disables character-based frame parsing.

The firmware can also evaluate frame boundaries by measuring silent periods on the physical bus. Bus quietness is calculated as equivalent character transmission windows relative to the active baud rate. Input a valid threshold scale from 0 to 255 inside the Packet complete idle characters field. Setting this value to 0 turns off the timer; a value of 1 instructs the engine to close the active buffer as soon as the line remains idle for the duration of a single character slot. Both frame demarcation methods can run concurrently.



Embedded Testing Tools (TOOLS)

The web interface features basic testing utilities to inject raw test payloads directly onto the physical bus lines. The input field labeled Remote RS485 message transmits short text segments directly to the remote IP endpoints assigned within the network configuration panels (MODE) over open TCP or UDP sockets. Click Send to fire the payload.

The utility labeled Local RS485 message allows operators to transmit manual command strings from the active interface directly out of the local converter's RS485 transceiver. Click Send to execute the serial transmission.