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:
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:
%PROGRAMFILES%\MVTec\MERLIC-26.03\bin\x64-win64%LOCALAPPDATA%\Programs\MVTec\MERLIC-26.03\bin\x64-win64<INSTALLATION_DIR>/merlic_26.03.0/bin/x64-linux<INSTALLATION_DIR>/merlic_26.03.0/bin/aarch64-linuxTo 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.
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.
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.
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.
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:
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.