Table of Contents

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.

Downloads

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

Key Features

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

Installation & First Run

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

Windows

.\PlcTool.exe --help

GNU/Linux

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/
./PlcTool --help

Common Commands

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

1. Network Scan (scan)

./PlcTool scan
./PlcTool scan -ia 192.168.2.1

2. Verify Controller Status (wait)

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

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

3. Licensing (license)

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

4. Upload Solution (upload-image)

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>

5. Upload HMI / Website (upload-web)

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

6. Configuration (download-config / upload-config)

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

Automated Usage (Scripting)

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"