Providing the Plugins for MERLIC RTE

After implementing and building a communication plugin, you have to make sure that the plugin is available for MERLIC RTE. Otherwise, the communication plugin will not be shown in the list of available communication plugins when adding a new plugin instance in the MERLIC Runtime Environment Setup (MERLIC RTE Setup).

MERLIC only recognizes a communication plugin if the following prerequisites are fulfilled:

  • The dynamic library of the plugin is placed in the specified plugin directory.
  • The file name of the dynamic library begins with the prefix "pMV", for example, "pMVevent-logger.dll".

Default Plugin Directory

When starting MERLIC RTE, a predefined location is checked for the available communication plugins. We refer to this location as "plugin directory". Only the plugins in this location are recognized and can be used with MERLIC RTE.

By default, MERLIC searches the directory where the MERLIC executable files are located. This directory also contains the libraries of the communication plugins provided by MERLIC, including the example plugins.

On Windows system, the default location depends on the installation type:

  • Windows installation for all users: %PROGRAMFILES%\MVTec\MERLIC-26.10\bin\x64-win64
  • Windows installation for current user: %LOCALAPPDATA%\Programs\MVTec\MERLIC-26.10\bin\x64-win64
  • Linux installation - PC-based: <INSTALLATION_DIR>/merlic_26.10.0/bin/x64-linux
  • Linux installation - Arm®-based: <INSTALLATION_DIR>/merlic_26.10.0/bin/aarch64-linux

To ensure that MERLIC RTE can find and use your custom plugin, you have to either copy the plugin to the default plugin directory or you have add the directory in which the plugin is stored to the list of plugin directories. Otherwise, the communication plugin cannot be found and will not be available for use in the MERLIC RTE Setup.

Using the Default Plugin Directory

If you want to store your custom plugin next to the communication plugins provided by MERLIC, copy the plugin library after the build to the respective default plugin directory.

Using a Different or Multiple Plugin Directories

If you need or want to store your custom plugin in a different location, for example, because you want to keep the plugin library in the respective build output directory, add the respective location to the list of plugin directories. This way, you can use communication plugins from different directories in the same MERLIC RTE instance. Make sure to specify all directories in which communication plugins are located, including the default location of the communication plugins provided by MERLIC.

You can configure the list of plugin directories via the INI configuration file using the "PluginDir" property in the [Communicator] section. For more information, see Additional Settings for Communication Plugins in the MERLIC Manual.

All specified plugin directories will be searched for plugin libraries with the required "pMV" prefix for communication plugins. In the MERLIC RTE Setup, you will get a list of all communication plugins that have been found in the specified directories.

Providing the Directory for Additional Files

When loading a communication plugin from a custom plugin directory, any indirect library dependencies, that is, DLL files, which are located in the same directory as the plugin, are automatically resolved when using Windows. For Linux, you have to set the RPATH of your plugin manually for the MERLIC RTE executable to be able to load additional files. The required settings can be copied from the CMakeLists.txt of our example plugins and adapted for your project.

Naming Convention - Prefix "pMV"

In addition to the location of the plugins, you have to make sure to adhere to the following naming convention for communication plugins:

The name of the respective dynamic library must begin with the prefix "pMV".

When MERLIC searches the specified plugin directories for communication plugins, only the ones with the prefix "pMV" will be recognized. Therefore, you have to add the prefix "pMV" to the file name of the plugin's dynamic library after building the plugin.

In the "Communication" tab of the MERLIC RTE Setup, this prefix is not visible at the names of the listed plugins but it is used to differentiate plugins from any other dynamic libraries which may be placed in the same directory as plugin dependencies. For example, "pMVevent-logger.dll" on Windows or "pMVevent-logger.so" on Linux corresponds to the plugin named "event-logger".

As soon as your plugin is stored in the defined plugin directory with the required prefix, you can start using the plugin with MERLIC RTE.