# Which Plugins to load (appsettings.xml)

## appsettings.xml overview

Open the appsettings.xml file with a text editor of your choice. Preferably, you can use a dedicated XML editor, as the Senseforce Edge XML files are supported by a rich set of XML schemas, allowing configuration validation inside the editor.&#x20;

A minimum appsettings.xml is illustrated below.

```markup
<?xml version="1.0" encoding="utf-8"?>
<AgentConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="https://senseforce.io/ configurations/Schemas/appsettings.xsd" >
  <EgressPlugins>
    <!--Add your output plugins here-->
  </EgressPlugins>
  <IngressPlugins>
    <!--Add your input plugins here-->
  </IngressPlugins>
  
  <!-- Mode: Live or offline -->
  <Mode>Live</Mode>
  
  <!-- Where to find the data routing definition file -->
  <Mappings>
    <FilePath>$(LunaAppDataPath)configurations</FilePath>
    <FileName>EventDefinition.xml</FileName>
  </Mappings>
  
  <!-- Where to put the log file and which log level to set -->
  <Logger>
    <FilePath>$(LunaAppDataPath)Logs</FilePath>
    <FileName>agent.log</FileName>
    <!--LogLevel: Debug,Information,Warning,Error,Critical,None-->
    <LogLevel>Information</LogLevel>
  </Logger>
</AgentConfiguration>

```

### Define which Input Plugins to load

To define which plugin to load, add one or more of the following configuration sections inside the "**IngressPlugins**"-section (Line 7 to 9)

{% tabs %}
{% tab title="S7" %}

```markup
<IngressPlugin name="S7Net">
    <FilePath>$(RuntimePath)Plugins/Ingress/S7Net/S7Net.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.S7Net.S7NetHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/S7Net/S7Settings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="MS SQL" %}

```markup
<IngressPlugin name="MsSQL">
    <FilePath>$(RuntimePath)Plugins/Ingress/MsSql/MsSql.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.MsSql.MsSqlHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/SQL/SqlSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="SQLite" %}

```markup
<IngressPlugin name="Sqlite">
    <FilePath>$(RuntimePath)Plugins/Ingress/Sqlite/Sqlite.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.Sqlite.SqliteHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/SQLite/SqliteSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="OpcUA" %}

```markup
<IngressPlugin name="OpcUa">
    <FilePath>$(RuntimePath)Plugins/Ingress/OpcUa/OpcUa.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.OpcUa.OpcUaHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/OPCUA/OpcUaSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="REST" %}

```markup
<IngressPlugin name="Rest">
    <FilePath>$(RuntimePath)Plugins/Ingress/Rest_Schildknecht/Rest_Schildknecht.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.Rest_Schildknecht.RestSchildknechtHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/Rest_Schildknecht/RestSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="TCP Listener" %}

```xml
<IngressPlugin name="Tcp">
    <FilePath>$(RuntimePath)Plugins/Ingress/TcpSocketRead/TcpSocketRead.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.TcpSocketRead.TcpSocketReadHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/TcpSocketRead/TcpSocketSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="XML Parsing" %}

```xml
<IngressPlugin name="Xml">
    <FilePath>$(RuntimePath)Plugins/Ingress/XmlFileParsing/XmlFileParsing.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.XmlFileParsing.XmlFileParsingHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/XmlFileParsing/XmlFileParsingSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="SINUMERIK" %}

```xml
<IngressPlugin name="Sinumerik">
    <FilePath>$(RuntimePath)Plugins/Ingress/SiemensPlc/SiemensPlc.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.SiemensPlc.SiemensPlcHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/SiemensPlc/SiemensPlcSettings.xml</ConfigurationFile>
</IngressPlugin>
```

{% endtab %}

{% tab title="Heidenhain" %}

```xml
  <IngressPlugin name="Heidenhain_demo">
    <FilePath>$(RuntimePath)Plugins/Ingress/Heidenhain/Heidenhain.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Ingress.Plugins.Heidenhain.HeidenhainHandler</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/InputPlugins/Heidenhain/HeidenhainSettings.xml</ConfigurationFile>
  </IngressPlugin>
```

{% hint style="success" %}
The default configuration files for the Heidenhain plugin are located in the Plugins installation folder (`Plugins/Ingress/Heidenhain/configs`). Copy them to `[YourConfigLocation]/configurations/InputPlugins/Heidenhain/.` (This is C:/Program Files/Luna/configs if you run the Edge as command line application and `C:/ProgramData/Senseforce/Luna Data/Your`*`ServiceName_X`*`/configs` if you run the Edge as a service. If you run your edge as a Linux service, copy the configs to the location where the configs of your other plugins are located)
{% endhint %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The plugin attribute "**name**" is reserved for future use and does not provide any further service.
{% endhint %}

{% hint style="info" %}
It is possible to load more than one Input Plugin. Simply add several of the above configuration sections (5 lines per plugin) to appsettings.xml, one below each other.
{% endhint %}

### Define which Output Plugins to load

To define which output plugin to load, add one or more of the following configuration sections inside the "**EgressPlugins**"-section (Line 4 to 6)

{% tabs %}
{% tab title="MQTT" %}

```markup
<EgressPlugin name="Mqtt_senseforce">
    <FilePath>$(RuntimePath)Plugins/Egress/MqttNet/MqttNetPlugin.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Egress.Plugins.MqttNet.MqttHandlerTpl</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/OutputPlugins/MqttNet/MqttSettings.xml</ConfigurationFile>
</EgressPlugin>
```

{% endtab %}

{% tab title="SQLITE" %}

```markup
<EgressPlugin name="Sqlite_senseforce">
    <FilePath>$(RuntimePath)Plugins/Egress/Sqlite/SqliteOut.dll</FilePath>
    <TypeName>Senseforce.Agent.Extensibility.Egress.Plugins.Sqlite.SqliteHandlerTpl</TypeName>
    <ConfigurationFile>$(LunaAppDataPath)configurations/OutputPlugins/Sqlite/SqliteSettings.xml</ConfigurationFile>
</EgressPlugin>
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
The plugin attribute "**name**" is used for data routing. Make sure it is unique throughout all plugins (which unique name you choose is up to you). Remember this name for the data routing process.
{% endhint %}

{% hint style="info" %}
It is possible to load more than one Output Plugin. Simply add several of the above configuration sections (5 lines per plugin) to appsettings.xml, one below each other.
{% endhint %}

### Defining Data Routing Definition and Logging file path

Using the **FileName** and **FilePath** settings on line 16/17 as well as 22/23 it is possible to change the location where the Edge Solution expects the Data Routing Definition as well as the Logging output path. For most cases, it is best to leave these settings on default.

### Change Log-Level

Using the setting LogLevel on line 25 allows setting how much information is written to the log files. All plugins integrate their own log files with their own logging configuration. The setting in appsettings.xml only changes the log-level for the Edge core application.

Please check the edge-logging page for more information:

<https://manual.senseforce.io/manual/senseforce-edge/edge-configuration/edge-logging>

### Application Mode

Using the "Mode"-setting allows disabling the live date transmission.&#x20;

| Mode    | Consequence                                                                                                                                                                                                                                                                           |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Live    | The Edge solution connects with the remote servers and transmits data from input to output.                                                                                                                                                                                           |
| Offline | The Edge solution connects with the remote servers but only reads the data and transmits them to the output - but does not deliver it past the output plugin. Use this setting to commission your Edge software as well as for troubleshooting. Best combined with **LogLevel** Trace |

### Example appsettings.xml file

{% file src="/files/-Lj7EGhvkGHd8dpamjyk" %}
appsettings.xml
{% endfile %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.senseforce.io/manual/senseforce-edge/edge-configuration/which-plugins-to-load-appsettings.xml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
