The Communicator .ini File

This topic describes how to use the Communicator configuration file to configure the logging and port settings for an additional instance The term instance is used to describe a new or additional context based on a model, e.g., an executeble, plug-in, etc. Therefore limitations, parameters, and values can differ from one instance to another, e.g., based on command line parameters and .ini settings. It is possible to start multiple instances of Communicator plug-ins. of the Communicator.

This configuration file should only be used if you want to manually start an additional instance of the Communicator in MERLIC process integration mode without having to manually add the desired command line arguments to "merlic_rte.exe" every time.

Typically you start only one instance of the Communicator with a plug-in configured in the MERLIC RTE Setup. In this case you can add the section [Communicator] to the MERLIC .ini file ("MERLIC5.ini" by default) that is used with "merlic_rte.exe" instead of defining the ports in the command line.

For more information see the section Communicator in the .ini topic of the MERLIC manual.

Creating a Communicator.ini File

The Communicator configuration file must be created and edited manually because the Communicator does not change or save any settings. Therefore the "Communicator.ini" file will not be created automatically. However, the Communicator loads an existing file named "Communicator.ini" in the default directory during start up if it exists. Lines starting with "#" are ignored by the MERLIC Communicator and can be used as comments.

For more information about the default directory, see the section Location.

For more information about starting the MERLIC Communicator with a custom .ini file, i.e. with a different name or in a different location, see the section Using Additional .ini Files.

General Information

Location

The default directory for the "Communicator.ini" file is "C:\Users\<username>\AppData\Roaming\MVTec", i.e., the same directory as the .ini file MERLIC is started with. You can also enter %APPDATA%\MVTec into your file explorer to reach that directory.

Using Additional .ini Files

You can start the MERLIC Communicator with an .ini file, that is stored in a different location or has a different name, using the command line:

  1. Open a command prompt and change to the "bin\x64-win64" directory within the MERLIC installation path, for example, "%PROGRAMFILES%\MVTec\MERLIC-5.6\bin\x64-win64".
  2. Enter the following command to start the Communicator with a different .ini file.
    Copy
    merlic_communicator.exe --ini <FILE>

Overriding the Properties in the .ini File

If you start the MERLIC Communicator via the command line, you have the possibility to override some properties of the .ini file. You can use the available command line options to define specific settings for the current session. The specified option in the command line will override the value that is set for respective property in the "Communicator.ini" and "MERLIC5.ini" file. The same applies for the properties defined in the .ini file for MERLIC, i.e., "MERLIC5.ini" by default. If a "Communicator.ini" is used, the respective properties in the "Communicator.ini" file will override the configuration of the default "MERLIC5.ini" file.

Structure and Encoding

The .ini file is structured in different sections that contain the settings for the respective component. All sections are optional, i.e., the Communicator will start if all, any, or none of them are included. The names of the sections are specified in square brackets [ ] in the .ini file. When editing the .ini file, you can add new sections anywhere above or below existing sections.

The .ini file requires an UTF-8 character encoding on all platforms. It is possible to use regular slashes "/" and backslashes "\" as path separators in the "Communicator.ini" file. Lines starting with "#" are ignored by MERLIC.

Sections

In the following, you can find detailed information on the available sections and properties for the "Communicator.ini" file. Currently, you may define properties in the following sections:

All sections are optional, i.e., the Communicator will start if all, any, or none of them are included.

[Communicator]

This section contains properties regarding the communication between the Communicator and MERLIC, and directory settings.

Property

Default

Description

Corresponding Command Line Argument

CommandPort

21591

This property defines the command port that should be used for the communication of the MERLIC Communicator with MERLIC in process integration mode.

--command_port

CommandTimeout

5000 [ms]

This property defines the timeout in milliseconds for commands sent by plug-ins in case the Communicator is not responding.

--command_timeout

ConfigDir

%APPDATA%/MVTec/Communicator/conf

This property defines the directory for plug-in configuration files.

--config_dir

EventPort

21590

This property defines the event port that should be used for the communication of the MERLIC Communicator with MERLIC in process integration mode.

--event_port

PluginConfigurationPorts

This property defines fixed ports for the configuration services for Communicator plug-ins when using the MERLIC RTE Setup on a remote system. You have to specify three ports to ensure that the remote configuration works correctly, e.g., "10123;10124;10125". You may use ports in the range of 1024 to 65535 from the operating system. If you are using this property to set the ports, you have to ensure the following conditions:

  • The specified ports must be free. Otherwise the Communicator will not start and the configuration in the MERLIC RTE Setup cannot be accessed.
  • The specified ports should not overlap the ones defines for the property "ImageSourceConfigurationPorts" in the [General] section of the "MERLIC5.ini" file. Otherwise the configuration services cannot operate at the same time.

If this property is used to define fixed ports, only one instance of MERLIC Communicator can be started.

--plugin_config_ports

PluginDir

If MERLIC was installed with administrator rights:

%PROGRAMFILES%\MVTec\MERLIC-5.6

If MERLIC was installed without administrator rights:

%LOCALAPPDATA%\Programs\MVTec\MERLIC-5.6

This property defines the directory where to look for plug-ins. It is also possible to define multiple plug-in directories as a semicolon-separated list. For more information see the section Changing the Plug-in Directory in the topic Changing Communicator and Plug-in Settings.

--plugin_dir

[Logging]

This section contains properties regarding naming convention, path, size, and number of log files, that are generated by the Communicator, as well as the message threshold.

Property

Default

Description

LogFilePath

%LOCALAPPDATA%\MVTec\MERLIC\

This property defines the path to the directory in which the log file is stored.

You can use slashes (/), backslashes (\) or double backslashes (\\) for file paths in MERLIC .ini files. However, MERLIC will internally store the paths with slashes (/).

LogFileSizeInBytes

10 485 760 (= 10 MB)

This property defines the maximum size of the log files in bytes. If the maximum size of the log file is reached and the property "LogFilesCount" > 1, MERLIC will start to log the new messages into a new file. In case the maximum number of allowed log files is reached, MERLIC will start to overwrite the oldest messages.

Minimum value: 1 048 576 = 1 MB

LogFilesCount

10

This property defines the maximum number of log files that are kept in the log file directory. If the maximum size is reached for each log file, MERLIC will delete older log files.

Threshold

info

This property defines the used log level. Logging of messages of a given level generally includes the logging of all messages of stricter levels. The available log levels are the following:

  • none: No messages are logged.
  • critical: Messages of severity "critical" contain information on errors that cause MERLIC to crash.
  • error: Messages of severity "error" contain information on errors, e.g., for MERLIC tools. If this log level is selected, also the messages of severity "critical" are logged.
  • warning: Messages of severity "warning" contain information that indicate a problem, e.g., at a MERLIC tool. If this log level is selected, also the messages of severity "critical" and "error" are logged.
  • info: Messages of severity "info" contain general non-critical information. If this log level is selected, also the messages of severity "critical", "error", and "warning" are logged.
  • trace: Messages of severity "trace" contain detailed information that might be useful to understand the context of warnings or error messages. If this log level is selected, also the messages of severity "critical", "error", "warning", and "info" are logged.

The log files are generated with the following naming convention: "merlic_communicator_<YYYY-MM-DD>_<hh-mm-ss>_<ProcessID>_<Counter>.log".

Placeholder

Description

YYYY

Year

MM

Month

DD

Day

hh

Hour

mm

Minute

ss

Second

ProcessID

Windows process ID of the respective Communicator instance

Counter

Counter of the log file. It is increased whenever the Communicator starts logging to a new log file, i.e., if the log file exceeds the maximum size, that has been set in "LogFileSizeInBytes". For each start up of a Communicator instance, the counter is reset to 0.