> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Route Configuration

> Edit route configuration, events, mappings, and tags in Visual or LoT mode

<Frame caption="Route Configuration panel in the Coreflux HUB — edit settings, events, mappings, and tags in Visual or LoT mode">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-configuration.gif?s=0e63012e74e74080dd1348afd5f42290" alt="Coreflux HUB Route Configuration panel showing Visual Mode and LoT Mode toggle with configuration, events, and mappings tabs" width="800" height="500" data-path="images/routes-configuration.gif" />
</Frame>

## Why Configure Routes in the Coreflux HUB?

You need to adjust route settings—connection parameters, events, mappings, and tags—without editing files or publishing MQTT commands. The Route Configuration in the HUB lets you edit routes with a form-based Visual Mode or switch to LoT Mode to modify the raw LoT code by hand.

## When to Use It

* **Updating connection settings** — Change IP, port, credentials, or other config fields
* **Adding events or mappings** — Extend a route with new events, mappings, or tags
* **Switching modes** — Use Visual Mode for guided editing or LoT Mode for full control

For an overview of how to add routes, select route types, and use templates, see [Routes Overview](/coreflux-hub/routes/overview).

***

## Visual Mode vs LoT Mode

| Mode            | Best For                                                          |
| --------------- | ----------------------------------------------------------------- |
| **Visual Mode** | Form-based editing with add/remove fields, modals, and validation |
| **LoT Mode**    | Direct LoT code editing for power users who prefer hand-editing   |

Toggle between modes using the **Visual Mode** / **LoT Mode** toggle at the top of the route configuration panel. Changes in either mode are applied when you click **Save Changes**.

### LoT Mode

Switch to **LoT Mode** to view and edit the full route definition as LoT code. This gives you direct control over the syntax and is useful for copying configurations or making bulk changes.

<Frame caption="LoT source editor in Config: SiemensS7Route showing the full route definition as editable LoT code with Cancel and Save Changes controls">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-lot-mode.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=6368de8667c1bcb266843435470742a4" alt="Coreflux HUB Route Configuration LoT source editor for SiemensS7Route showing syntax-highlighted DEFINE ROUTE SiemensS7Route WITH TYPE SIEMENS_S7 with an S7_CONFIG block (IP, CPU_TYPE, RACK, SLOT), a MAPPING TestPLC block with SOURCE_TOPIC, EVERY, and a Real TAG with ADDRESS, ADDRESS_TYPE, and DATA_TYPE, plus Cancel and Save Changes buttons in the bottom bar" width="1024" height="639" data-path="images/routes-lot-mode.png" />
</Frame>

### Renaming Elements

You can rename routes, events, mappings, and tags directly from the configuration panel. Click the **pencil icon** next to any element name to turn it into an editable text field, type the new name, and press **Enter** to confirm. A **Renamed** badge appears briefly to confirm the change.

This works the same way for all element types:

* **Route name** — Displayed at the top of the configuration panel
* **Event name** — Displayed in the Events tab header for each event
* **Mapping name** — Displayed in the Mappings tab header for each mapping
* **Tag name** — Displayed in the tag header within a mapping

<Note>
  Renaming takes effect when you click **Save Changes**. If you cancel without saving, the original names are restored.
</Note>

***

## Configuration Tab

The **Configuration** tab shows the route's connection and protocol settings (e.g., `S7_CONFIG`, `SQL_CONFIG`, `MODBUS_CONFIG`). Each field displays its name, whether it is required or optional, its data type, and a description.

<Frame caption="Configuration tab for Route: SiemensS7Route showing the S7 Configuration fields with types, descriptions, and current values">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-config-tab.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=9ab963bbf69eaab2a7bc2b1e9ab8fee3" alt="Coreflux HUB Route Configuration tab for Route: SiemensS7Route with Configuration, Events, and Mappings tabs; Configuration is selected showing the S7 Configuration section with four fields — IP required string set to 127.0.0.1, CPU_TYPE string set to S71200, RACK int set to 0, and SLOT int set to 1 — plus an + Add Field button and Cancel and Save Changes buttons at the bottom" width="1024" height="639" data-path="images/routes-config-tab.png" />
</Frame>

* **View fields** — See all configuration fields with their types and descriptions
* **Edit field** — Change values in the input fields
* **Add field** — Click **+ Add Field** to add optional fields from a list of available parameters
* **Delete field** — Use the delete icon on a field to remove it

### Adding a Configuration Field

Click **+ Add Field** to open the **Add Configuration Field** modal. This shows all optional fields available for the route type, along with their data types and descriptions.

<Frame caption="Add Configuration Field modal listing the optional parameters available for a Siemens S7 route">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-config-add-field.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=af19be17d7706e7b0113ce7ec6962ef8" alt="Coreflux HUB Add Configuration Field modal prompting to select an optional field to add to the route configuration, listing PORT int for the TCP port for S7 connection (default 102), CONNECTION_TYPE string with four options PG, OP, S7BASIC, and S7_BASIC (default PG), RETRY_ATTEMPTS int for number of retry attempts (default 3), RETRY_TIME_SECONDS int for seconds to wait between retries (default 5), REFRESH_TIME_MS int for refresh time in milliseconds (default 1000), and a partially visible READ_TIMEOUT int field" width="1024" height="639" data-path="images/routes-config-add-field.png" />
</Frame>

***

## Events Tab

The **Events** tab manages event definitions for the route. Events define how the route reacts to MQTT messages—typically by reading from or writing to the connected device or service.

<Frame caption="Events tab for Route: SiemensS7Route showing the OnDemandRead event with SOURCE_TOPIC, DESTINATION_TOPIC, and QUERY fields">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-events-tab.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=78ff56e9f1551b435f205332c6a60e38" alt="Coreflux HUB Route Configuration Events tab for Route: SiemensS7Route showing Event ONDEMANDREAD with 3 fields — SOURCE_TOPIC string set to s7sim/event/read, DESTINATION_TOPIC string set to s7sim/event/read/result, and QUERY string containing a JSON S7 operation with operation, address, data_type, and count placeholders — plus + Add Event and + Add Field controls and Cancel and Save Changes buttons" width="1024" height="639" data-path="images/routes-events-tab.png" />
</Frame>

* **Add Event** — Click **+ Add Event** to create a new event with a name and fields
* **Rename event** — Click the pencil icon next to the event name to rename it
* **Edit event** — Expand an event to view and edit its fields (e.g., `SOURCE_TOPIC`, `DESTINATION_TOPIC`, `QUERY`)
* **Add field** — Use **+ Add Field** within an event to add optional fields

### Adding an Event Field

Click **+ Add Field** inside an event to open the **Add Event Field** modal. This shows the optional fields available for the event.

<Frame caption="Add Event Field modal showing the optional DESTINATION_TOPIC field available for the event">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-events-add-field.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=dc176ed95ed8d83cb45ba21090c7b987" alt="Coreflux HUB Add Event Field modal prompting to select an optional field to add to the event, showing a single option DESTINATION_TOPIC string described as MQTT topic to publish S7 results" width="1024" height="639" data-path="images/routes-events-add-field.png" />
</Frame>

***

## Mappings Tab

The **Mappings** tab manages mapping definitions and tags. Mappings define periodic data polling from a connected device—reading tags at a set interval and publishing the data to MQTT topics.

<Frame caption="Mappings tab for Route: SiemensS7Route showing the TestPLC mapping with SOURCE_TOPIC and EVERY fields and a Real tag with address and data type properties">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-mappings-tab.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=d86d0a5af5b238b598b0dc59c2b0e536" alt="Coreflux HUB Route Configuration Mappings tab for Route: SiemensS7Route showing Mapping TESTPLC with Mapping Configuration (SOURCE_TOPIC string set to plc, EVERY string set to 1 SECOND) and a Tags section containing the Real tag with ADDRESS string set to DB1.DBD28, ADDRESS_TYPE string set to DATABLOCK, and DATA_TYPE string set to REAL, plus + Add Mapping, + Add Field, + Add Tag, and + Field controls and Cancel and Save Changes buttons" width="1024" height="639" data-path="images/routes-mappings-tab.png" />
</Frame>

* **Add Mapping** — Click **+ Add Mapping** to create a new mapping with a name, mapping fields, and tags
* **Rename mapping** — Click the pencil icon next to the mapping name to rename it
* **Edit mapping** — Expand a mapping to edit its configuration (e.g., `EVERY`, `SOURCE_TOPIC`) and tags
* **Add Tag** — Use **+ Add Tag** within a mapping to add tags with address, data type, and other properties

### Adding a New Mapping

Click **+ Add Mapping** to open the **Add New Mapping** modal. Enter a mapping name, then use **+ Add Field** and **+ Add Tag** to build the mapping.

<Frame caption="Add New Mapping modal with a name field, a mapping fields section, and a tags section, plus Cancel and Create Mapping actions">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-add-mapping.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=254c5132d9a89643258f7889f1a0365c" alt="Coreflux HUB Add New Mapping modal titled Create a new mapping with optional fields and tags, showing a Mapping Name input with an e.g., MyMapping placeholder, a Mapping Fields (0) section with an + Add Field button, a Tags (0) section with an + Add Tag button and a No tags added yet placeholder, plus Cancel and Create Mapping buttons" width="1024" height="639" data-path="images/routes-add-mapping.png" />
</Frame>

### Adding a Mapping Field

Click **+ Add Field** inside a mapping to open the **Add Mapping Field** modal. This shows the optional fields available for the mapping, such as `DESTINATION_TOPIC` and `QUERY`.

<Frame caption="Add Mapping Field modal showing the optional DESTINATION_TOPIC and QUERY fields available for the mapping">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-mapping-add-field.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=4d60152ac9e30f2f7664951f24a7eecb" alt="Coreflux HUB Add Mapping Field modal prompting to select an optional field to add to the mapping, showing DESTINATION_TOPIC string described as MQTT topic to publish polled data (legacy mode) and QUERY string described as S7 read operation in JSON format (legacy mode)" width="1024" height="639" data-path="images/routes-mapping-add-field.png" />
</Frame>

#### Tags

Tags are defined inside mappings. Each tag represents a data point to read from the connected device. You can add, edit, rename, and remove tags and their properties (address, address type, data type, scaling, unit, etc.) from the Mappings tab. To rename a tag, click the pencil icon next to the tag name.

#### Saving and Canceling

* **Save Changes** — Applies all edits to the broker
* **Cancel** — Discards unsaved changes and closes the configuration panel

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Routes Overview" icon="plus" href="/coreflux-hub/routes/overview">
    Create new routes with templates or LoT code.
  </Card>

  <Card title="Routes Monitoring" icon="chart-line" href="/coreflux-hub/routes/monitoring">
    View and export route-specific logs and status.
  </Card>
</CardGroup>
