Providing the Plug-ins for MERLIC RTE

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

MERLIC only recognizes a communication plug-in if the following prerequisites are fulfilled:

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

Default Plug-in Directory

When starting MERLIC RTE, a predefined location is checked for the available communication plug-ins. We refer to this location as "plug-in directory". Only the plug-ins 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 plug-ins provided by MERLIC, including the example plug-ins.

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

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

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

Using the Default Plug-in Directory

If you want to store your custom plug-in next to the communication plug-ins provided by MERLIC, copy the plug-in library after the build to the respective default plug-in directory.

Using a Different or Multiple Plug-in Directories

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

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

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

Providing the Directory for Additional Files

When loading a communication plug-in from a custom plug-in directory, any indirect library dependencies, that is, DLL files, which are located in the same directory as the plug-in, are automatically resolved when using Windows. For Linux, you have to set the RPATH of your plug-in 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 plug-ins and adapted for your project.

Naming Convention - Prefix "pMV"

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

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

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

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

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