# FenixServer — User Guide **FenixServer** is the server edition of Fenix. It runs in the background, communicates with your industrial devices, and exposes all data through a built-in REST API. Use it as a gateway between your PLCs and any HTTP-based system — web dashboards, mobile apps, cloud services, or SCADA software. --- ## 1. Starting the Server FenixServer can run in three modes: ### Manual Mode (default) Double-click `FenixServer.exe`. The window opens and waits — you load a project and control everything manually. ### Auto-Run Mode ``` FenixServer.exe -r ``` Loads the last project automatically and starts all drivers without any user interaction. Perfect for unattended servers that need to resume after a reboot. ### Simulation Mode ``` FenixServer.exe -s ``` Runs without hardware. All drivers pretend to work — great for testing your REST API client or web dashboard before deploying to production. > Only one instance can run at a time. Trying to start a second one shows a warning. --- ## 2. The Server Window ``` ┌─────────────────────────────────────────────────────────────┐ │ [Open Project] [▶ Start] [■ Stop] [🌐 Browser] Status │ ├──────────────────────────────┬──────────────────────────────┤ │ Connections │ Selected Connection │ │ Type | Name | Status | ... │ Properties │ ├──────────────────────────────┴──────────────────────────────┤ │ Events Log — time-stamped messages │ ├─────────────────────────────────────────────────────────────┤ │ Status bar: alarm count | last message │ └─────────────────────────────────────────────────────────────┘ ``` ![FenixServer main window](lib/fenix-server-overview.png) --- ## 3. Loading a Project 1. Click **Open Project**. 2. Choose a `.pse` file (created in Fenix). 3. All connections from the project appear in the Connections grid. > Projects are configured in **Fenix** — see the [Fenix User Guide](Fenix.md). --- ## 4. Controlling Communication | Button | What It Does | |--------|-------------| | ▶ **Start** | Activates all drivers. Devices are polled, tags update, and the REST API starts serving live data. | | ■ **Stop** | Gracefully stops all drivers. Communication pauses but the web API stays online. | The **Status** indicator shows whether communication is Running or Stopped. --- ## 5. Monitoring Connections The left side of the window shows all active connections: | Column | Meaning | |--------|---------| | **Kind** | Protocol — "Modbus TCP", "S7-300/400", etc. | | **Name** | Connection name from your project. | | **Protocol** | Technical protocol identifier. | | **Status** | *Running*, *Stopped*, or *Error*. | | **Sent** | Total requests sent to the device. | | **Received** | Total responses received from the device. | ![Connections grid](lib/fenix-server-connections.png) Click any row to see its full details — IP address, port, timeout, retries — in the **Properties** panel on the right. --- ## 6. Events and Alarms The **Events** panel at the bottom logs everything that happens: - Driver started / stopped - Connection errors and timeouts - Device communication failures The status bar shows the total alarm count and the most recent message. --- ## 7. Accessing the REST API Click the **🌐 Browser** button to open the API in your web browser. Call any endpoint directly: ``` http://localhost:80/api/tags http://localhost:80/health ``` For a complete walkthrough with code examples, see **[FenixServer.Api — User Guide](FenixServerApi.md)**. --- ## 8. Web Dashboard If your project includes web files (in the `Http/` folder), they are served automatically: ``` http://localhost:80/ ``` This means you can view a browser-based monitoring dashboard without installing anything extra. ![Browser view — light mode](lib/fenix-web-browser-light.png) ![Browser view — dark mode](lib/fenix-web-browser-dark.png) --- ## 9. Shutting Down Close the window. The server will: 1. Stop all drivers gracefully. 2. Shut down the web API. 3. Release all resources. For auto-run mode (`-r`), use **Windows Task Scheduler** to restart the app automatically after system reboots. --- ## How It Works (Briefly) Under the hood, FenixServer does three things simultaneously: 1. **Drivers** — the same Modbus and S7 communication engines from Fenix run in the background, polling your devices. 2. **Web Host** — an ASP.NET Core server is embedded directly in the application, no IIS required. It listens on port 80 (configurable) and serves both the REST API and static dashboard files. 3. **UI** — the WPF window gives you visibility into what's happening: connection status, sent/received counters, and an event log. All three components start and stop together. When you close the window, everything shuts down cleanly.