Skip to content

Server Configuration

Jens De Ketelaere edited this page Oct 31, 2025 · 5 revisions

Complete guide for configuring servers and registers in Server mode.

Server Settings

image

Server Name

Give your server a descriptive name to identify it when running multiple instances:

  • Displayed in the top bar
  • Saved with configuration files
  • Helpful when managing multiple servers

Port Configuration

Each server requires a unique network port:

  • Automatic assignment: Modbux automatically assigns the next available port
    • First server: 502 (standard Modbus TCP port)
    • Additional servers: Next available port (503, 504, etc.)
  • Manual override: You can manually change the port if needed
    • Range: 0-65535
    • Modbux validates port availability
    • Detects conflicts with other Modbux servers and system applications
  • Administrator privileges: Ports below 1024 may require elevated permissions on some systems

Managing Multiple Servers

Run up to 10 independent server instances simultaneously:

  1. Click the + Icon to add a new server
  2. Modbux automatically assigns the next available port (you can change it manually if needed)
  3. Each server maintains its own:
    • Port number
    • Server name
    • Unit ID configurations (248 Unit IDs per server)
    • Register configurations
  4. Switch between servers using the server selector button group
  5. Delete servers with the Trash Icon

Register Configuration

Adding Numeric Registers

image

To add an Input or Holding Register:

  1. Expand the appropriate register type container (Input Registers or Holding Registers)
  2. Click the Add Register button
  3. Configure the following parameters:

Address:

  • Range: 0-65535
  • Must not conflict with existing registers
  • Multi-register types automatically allocate consecutive addresses
  • Example: A double at address 100 occupies addresses 100-103

Data Type:

  • 16-bit types (1 register): int16, uint16
  • 32-bit types (2 registers): int32, uint32, float
  • 64-bit types (4 registers): int64, uint64, double

Value:

  • Static: Fixed value you set manually
  • Generator: Dynamic values that change automatically (see Value Generators section below)

Comment:

  • Optional descriptive text
  • Document register purpose, units, or value ranges
  • Helpful when sharing configurations

Endianness (32-bit and 64-bit types only):

  • Big Endian (BE): Default, Modbus standard (most significant byte first)
  • Little Endian (LE): Less common, for proprietary implementations

Adding Boolean Registers

Boolean registers (Coils and Discrete Inputs) are added in groups:

  1. Expand the register type container (Coils or Discrete Inputs)
  2. Click Add
  3. Configure:
    • Starting address: First bit address (0-65535)
    • Count: Number of bits to add (typically 8 or multiples of 8)
  4. Bits are added with consecutive addresses

This matches how Modbus groups bits into bytes for efficient communication.

Editing Registers

Numeric registers:

  • Click the Edit Icon (pencil) next to the register
  • Modify any parameter: address, data type, value, comment, endianness
  • Changes apply immediately

Boolean registers:

  • Click directly on the bit value to toggle it
  • Changes are instant and visible to connected clients

Deleting Registers

Individual deletion:

  • Click the Trash Icon next to the register
  • Register is removed immediately

Batch deletion:

  • Click Clear All button in the register container
  • Removes all registers of that type for the current Unit ID
  • Warning: Cannot be undone

Value Generators

image

Value generators create dynamic, changing values for realistic simulation. Instead of fixed values, generators produce random values within a specified range at regular intervals.

When to Use Generators

Use generators to simulate:

  • Sensor readings that fluctuate (temperature, pressure, humidity)
  • "Realistic" testing scenarios with changing data

Configuring a Generator

When adding or editing a numeric register, select Generator as the value type and configure:

Min Value:

  • Minimum value the generator will produce
  • Generator creates random values between min and max
  • Example: 15 for a temperature sensor with 15°C minimum

Max Value:

  • Maximum value the generator will produce
  • Must be greater than min value
  • Example: 30 for a temperature sensor with 30°C maximum

Interval (seconds):

  • How often the value updates
  • Range: 1-3600 seconds
  • Example: 2 seconds for a temperature sensor that updates every 2 seconds
  • Shorter intervals create more realistic simulation but use more CPU

The generator produces a new random value between min and max at each interval. Connected clients see the updated values in real-time.

Generator Behavior

  • Generators start automatically when the register is created
  • Values update at the specified interval continuously
  • Updates are visible to all connected clients in real-time
  • Generators persist across Modbux restarts (settings are saved)
  • You can switch a register between Static and Generator at any time

Supported Data Types

Generators work with all numeric data types:

  • Integer types: int16, uint16, int32, uint32, int64, uint64 (whole numbers only)
  • Floating point types: float, double (can generate decimal values)

Generators are not supported for boolean registers (Coils, Discrete Inputs) - use direct toggle instead.

Data Types Reference

Server mode supports 8 numeric data types:

16-bit Types (1 register)

  • int16: Signed integer, range -32,768 to 32,767
  • uint16: Unsigned integer, range 0 to 65,535

Most common types in Modbus.

32-bit Types (2 registers)

  • int32: Signed 32-bit integer
  • uint32: Unsigned 32-bit integer
  • float: IEEE 754 single-precision floating point (~7 decimal digits precision)

64-bit Types (4 registers)

  • int64: Signed 64-bit integer
  • uint64: Unsigned 64-bit integer
  • double: IEEE 754 double-precision floating point (~15 decimal digits precision)

Endianness

Multi-register types (32-bit and 64-bit) can use different byte orders:

  • Big Endian (BE): Default, Modbus standard (most significant byte first)
  • Little Endian (LE): Less common, for proprietary implementations (least significant byte first)

Toggle the LE indicator when editing a register to switch to Little Endian. For detailed explanation of endianness in Modbus, see Understanding Modbus.

Address Management

Automatic Address Allocation

Modbux automatically allocates consecutive addresses for multi-register types:

  • Float at address 100: Uses addresses 100 and 101
  • Double at address 200: Uses addresses 200-203
  • First available address is automatically suggested when adding registers

Address Conflict Prevention

The system validates that no registers overlap:

  • Attempting to add a register at an occupied address displays an error
  • Edit operations validate new addresses before applying
  • Multi-register types check all required addresses

Address Space Limits

Multi-register types must fit within the address space:

  • Maximum address: 65535
  • Invalid example: Double at address 65533 (would need 65533-65536, exceeding limit)
  • Modbux prevents these configurations

Saving and Loading Configurations

Saving Configurations

Click the SAVE button to export your server configuration:

What's saved:

  • Server name and port
  • All configured Unit IDs with their registers
  • Register addresses, data types, and values
  • Generator settings (min, max, interval)
  • Comments and endianness settings

File format:

  • JSON format
  • Human-readable and editable
  • Can be stored in version control

Use cases:

  • Backup configurations before making changes
  • Share test scenarios with team members
  • Maintain different device simulation profiles
  • Version control for configuration management

Loading Configurations

Click the OPEN button to load a saved configuration:

  • Opens file browser to select JSON configuration
  • Warning: Replaces current server configuration entirely
  • All Unit IDs from the file are loaded
  • Useful for quickly switching between test scenarios

Next Steps

Clone this wiki locally