PlcTool

PlcTool is a standalone command-line utility capable of performing many functions available in the Mervis IDE.

The main advantage of PlcTool over the standard IDE is its ability to be automated via scripts or external programs. It is ideal for batch management of controllers.

Please download the appropriate version for your operating system and architecture below:

PlcTool can perform the following actions on controllers running Mervis RT:

  • Scan: Search for PLCs on a selected network.
  • Info: Obtain status information about a specific PLC.
  • Upload: Upload compiled solutions (RT images) and HMI (web) projects.
  • Update: Update the Mervis RT version.
  • License: Apply or verify RT licenses.
  • Configuration: Download or upload RT configuration (XML).
  • Control: Restart the runtime.

The tool is distributed as an archive that must be unpacked after downloading.

  • Requirement: Windows x64. If issues occur, update your .NET Framework.
  • How to run:
    1. Press `Win + R`, type `cmd.exe`, and press OK.
    2. Navigate to the folder containing the unpacked tool.
    3. Run the help command:
.\PlcTool.exe --help
  • Supported Architectures: x64, ARM, and ARM64 (AArch64).
  • Setup:
    1. You can transfer the tool to the PLC via SCP or WinSCP.
    2. Make the file executable: `chmod +x PlcTool`.
    3. Dependencies: Depending on your system, you may need to install additional packages:
sudo apt install icu-devtools libssl-dev libssl1.1
  1. Environment Variables: If necessary, export the following variables before running:
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 
export DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/
  • How to run:
./PlcTool --help

Note: Most subcommands (except `scan`) accept mDNS names, proxy addresses, or domain names instead of IP addresses.

  • Local Scan: If no parameters are specified, it searches locally (loopback).
./PlcTool scan
  • Network Scan: To search a specific network, use the `-ia` (Interface Address) argument.
    • Note: On Linux, you cannot use the network address (e.g., .0) or broadcast (.255). Use an address ending in .1 (e.g., 192.168.2.1).
./PlcTool scan -ia 192.168.2.1

Sends a request to verify controller status, license, and RT version.

./PlcTool wait -h <host_address> -u admin -p rw-lok

Uploads a license code to the controller. Use `-up` if the license was already used previously.

./PlcTool license -h <host_address> -u admin -p rw -l <LICENSE_KEY> -up

Uploads a compiled program (`.exs` file found in the project's `bin` directory).

./PlcTool upload-image -h <host_address> -u admin -p rw -f <solution_guid>
  • Useful flags:
    • `-cf` : Clear Flash Variables
    • `-cr` : Cold Restart

Uploads the web interface files. You must restart the controller after uploading.

./PlcTool upload-web -h <host_address> -u admin -p rw -w <web_folder>/
./PlcTool reboot -h <host_address> -u admin -p rw

Configuration is stored in XML format. You can download it, edit manually, and upload it back.

# Download
./PlcTool download-config -h <host_address> -u admin -p rw -f ./config.xml
 
# Upload
./PlcTool upload-config -h <host_address> -u admin -p rw -f ./config.xml

PlcTool is designed for use in scripts. Below is an example Bash script that runs a scan and writes the output to a text file.

#!/bin/bash
 
# Navigate to script directory
cd "$(dirname "$0")"
 
# Set required environment variables
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/
 
# Run scan and pipe output to file
script -q -c "./PlcTool scan -o text | tee PlcTool.txt"
  • © Energocentrum Plus, s.r.o. 2017 - 2026