{"id":26440134,"url":"https://github.com/pozsarzs/modshell","last_synced_at":"2025-08-16T10:35:49.454Z","repository":{"id":212864053,"uuid":"731767758","full_name":"pozsarzs/modshell","owner":"pozsarzs","description":"Command-driven scriptable Modbus utility","archived":false,"fork":false,"pushed_at":"2024-10-24T18:11:01.000Z","size":3390,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-25T09:50:55.611Z","etag":null,"topics":["command-line","dos","freebsd","freepascal","gui","linux","modbus","rs232","scriptable","windows"],"latest_commit_sha":null,"homepage":"https://pozsarzs.github.io/modshell/","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pozsarzs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-14T20:44:15.000Z","updated_at":"2024-10-20T07:42:06.000Z","dependencies_parsed_at":"2024-01-24T22:23:38.439Z","dependency_job_id":"25d55c5e-3742-4ed3-9734-ebebe4cedb5a","html_url":"https://github.com/pozsarzs/modshell","commit_stats":null,"previous_names":["pozsarzs/modshell"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pozsarzs%2Fmodshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pozsarzs%2Fmodshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pozsarzs%2Fmodshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pozsarzs%2Fmodshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pozsarzs","download_url":"https://codeload.github.com/pozsarzs/modshell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189799,"owners_count":20412991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","dos","freebsd","freepascal","gui","linux","modbus","rs232","scriptable","windows"],"created_at":"2025-03-18T09:19:44.498Z","updated_at":"2025-08-16T10:35:49.432Z","avatar_url":"https://github.com/pozsarzs.png","language":"Pascal","readme":"\u003e [!WARNING]\r\n\u003e The program is still under development, it is not yet suitable for its task.  \r\n\u003e\r\n\r\n\u003cimg align=\"left\" style=\"float: left; margin: 0 10px 0 0;\" alt=\"ModShell icon\"\r\n  src=\"document/picture/modshell_96x96.png\"\u003e\r\n\u003cbr\u003e\r\n\r\n# Modshell\r\n\r\n**Command-driven scriptable Modbus utility**\r\n\r\nCopyright (C) 2023-2025 Pozsár Zsolt \u003cpozsarzs@gmail.com\u003e  \r\n\r\n## About this project\r\n\r\nThis project started in December 2023 as a Christmas project, to wind down the\r\nbusy end-of-year period.The original goal was to create a utility that would\r\nallow multiple Modbus devices of the same type to be configured without using\r\na touchpad.  \r\n\r\nThe project has grown considerably in size over time, but many features have\r\nbeen implemented that make it more useful. With the growth, the goal has also\r\nbeen reformulated: the program must have multiple user interfaces, be usable on\r\nmany operating systems, handle multiple communication channels and protocols, be\r\nsuitable for many tasks, and even work automatically.  \r\n\r\nThe next goal is to create a field (installed) or handheld (mobile) data\r\ncollector, converter, processor, etc., as well as a data and traffic monitoring\r\ndevice that works reliably, using this program, a single-board computer, and a\r\nmini HMI.  \r\n\r\nThe choice of source language fell on the outdated and neglected FreePascal.\r\nPartly because of its multiplatform nature ('Write once - compile everywhere'),\r\npartly because it is what I feel most comfortable with. I'm not sure it was the\r\nbest choice, but you have to make the most of it.  \r\n\r\nThe benefit of the project is not the finished product, as there are 'thousands'\r\nof similar products on the market. The biggest benefit is the development of\r\nlogical thinking and the knowledge we gain while programming, but the greatest\r\nis the joy of creation. And this is not dependent on the programming language.  \r\n\r\n## I. Features\r\n\r\nModShell is a utility built around a command interpreter, which with the\r\nconnected peripherals communicates via various ports using the Modbus, DCON and\r\nHART protocols.  \r\n\r\n|features                |                                                                                            |\r\n|------------------------|--------------------------------------------------------------------------------------------|\r\n|version                 |v0.1                                                                                        |\r\n|licence                 |EUPL v1.2                                                                                   |\r\n|language                |en, hu                                                                                      |\r\n|architecture            |amd64, armhf, i386, x86_64                                                                  |\r\n|operation system        |DOS, FreeBSD, Linux, Windows                                                                |\r\n|user interface          |ModShell: CLI and TUI                                                                       |\r\n|                        |XModShell: GUI                                                                              |\r\n|running modes           |normal or interpreter                                                                       |\r\n|variables               |max. 128 variables or constants (stored as string)                                          |\r\n|arrays                  |max. 32 dynamic size array of variables or constants (elements stored as string)            |\r\n|built-in commands       |135 commands in 10 categories with macro and script options)                                |\r\n|macros                  |max. 32                                                                                     |\r\n|script size             |max. 1024 line                                                                              |\r\n|example scripts         |10 scripts (shellscript and batch file versions)                                            |\r\n|load from file          |registers, script, settings                                                                 |\r\n|save to file            |command history, console and Modbus traffic, registers, communication settings, user log    |\r\n|auto save to file       |general settings and console traffic                                                        |\r\n|export to file          |history (TXT), registers (CSV, INI, XML)                                                    |\r\n|import to file          |registers (INI, XML)                                                                        |\r\n|configurable devices    |max. 8 settings, serial and ethernet port                                                   |\r\n|configurable protocols  |max. 8 settings, ASCII, RTU or TCP                                                          |\r\n|configurable connections|max. 8 settings by combining the previous two                                               |\r\n|raw serial communication|read/write serial port and mini serial console with A/N or Hex echo                         |\r\n|raw TCP communication   |read/write network device and mini TCP console with A/N or Hex echo                         |\r\n|raw UDP communication   |read/write network device and mini TCP console with A/N or Hex echo                         |\r\n|DCON communication      |read and write remote devices                                                               |\r\n|HART communication      |read and write remote devices                                                               |\r\n|Modbus communication    |read and write remote device and copy between devices                                       |\r\n|                        |internal server for remote access to own registers                                          |\r\n|                        |gateway to access devices using other ports or protocols                                    |\r\n|                        |internal serial monitor for decode ASCII or RTU telegrams                                   |\r\n|direct I/O port access  |supported                                                                                   |\r\n|GPIO port access        |supported on IPC (max. 64 port) and Raspberry Pi version 1-4                                |\r\n|local Modbus registers  |2x9999 boolean and 2x9999 word type                                                         |\r\n|script syntax plugins   |for editors using GtkSourceView, MCEdit, Micro, Nano, Notepad++, (Neo)Vim and VSCode        |\r\n|utility scripts         |2 script                                                                                    |\r\n|other utility programs  |command line serial Modbus traffic monitor, serial, TCP and UDP echo servers                |\r\n\r\n## II. Releases\r\n\r\n### Planned next releases up to v0.1\r\n\r\n...that either will or won't.  \r\n\r\n\u003cdetails\u003e\r\n \u003csummary\u003e\u003ci\u003ev0.1\u003c/i\u003e\u003c/summary\u003e\r\n This is \u003ci\u003efirst unstable release\u003c/i\u003e.\u003cbr\u003e\r\n Unstable, but it is already complete in its intended functionality.\r\n The software will not include any new features compared to the previous\r\n release, only bug fixes. All types of binary and installation packages\r\n will be released along with the source package.  \r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n \u003csummary\u003e\u003ci\u003ev0.1-beta3\u003c/i\u003e\u003c/summary\u003e\r\n \u003ci\u003eThird user test release\u003c/i\u003e will be with the following changes:\r\n \u003cul\u003e\r\n   \u003cli\u003egraphical monitoring the change of values over time (only XModShell);\u003c/li\u003e\r\n   \u003cli\u003eimplementation of additional Modbus functions.\u003c/li\u003e\r\n \u003c/ul\u003e\r\n Only a source package will be released.  \r\n\u003c/details\u003e\r\n\r\n### Actual release  \r\n\r\n_0.1-beta2_\r\n_Second user test release_ will be with the following changes:\r\n - [x] new command `abs`;  \r\n - [ ] new commands `gpioinit`, `gpioread`, `gpiowrite` (Industrial PC and RaspberryPi GPIO port support);  \r\n - [x] new command `input`;  \r\n - [x] new commands `pipe`, `stack`;  \r\n - [x] new command `swp`;  \r\n - [x] testscript directory for testing commands;  \r\n - [x] compressed HTML (CHM) help in addition to the existing online Wiki (only XModShell);  \r\n - [ ] HART protocol support;  \r\n - [ ] Modbus/TCP communication;  \r\n - [ ] TCP/UDP communication on DOS;  \r\n - [x] syntax highlighter and suggestion extension for Visual Studio Code.  \r\n Only a source package will be released.\r\n\r\n### Previous releases  \r\n\r\n\u003cdetails\u003e\r\n \u003csummary\u003e\u003ci\u003ev0.1-beta1\u003c/i\u003e\u003c/summary\u003e  \r\n \u003ci\u003eFirst user test release\u003c/i\u003e with the following changes:  \r\n \u003cul\u003e\r\n  \u003cli\u003eElimination of confusion between the terms 'register number' and 'data address'\u003c/li\u003e  \r\n  \u003cli\u003ein interpreter mode, passing parameters from the OS command line to the script and returning the script's exit value to the OS\u003c/li\u003e  \r\n  \u003cli\u003ein interpreter mode, command verbosity level setting with a predefined variable\u003c/li\u003e  \r\n  \u003cli\u003eANSI escape sequences support (only DOS and *nix like systems)\u003c/li\u003e  \r\n  \u003cli\u003ecommand `color` -\u003e `set color`, sets all default colors (CLI and TUI)\u003c/li\u003e    \r\n  \u003cli\u003ecommand `echo` -\u003e `echometh`, parameters: off/on/hex/swap -\u003e off/an/hex/swap\u003c/li\u003e  \r\n  \u003cli\u003ecommands `sercons`, `tcpcons`, `udpcons`: character-to-character or string sending, with alphanumerical or hexadecimal input, with or without alphanumerical or hexhexadecimal echo\u003c/li\u003e    \r\n  \u003cli\u003ecommands `serwrite`, `tcpwrite`, `udpwrite`: alphanumerical or hexadecimal input, with or without alphanumerical or hexadecimal echo\u003c/li\u003e  \r\n  \u003cli\u003eDCON protocol support\u003c/li\u003e    \r\n  \u003cli\u003ekeywords (coil, hreg, asc, hex, etc.) should also be specified from variables\u003c/li\u003e  \r\n  \u003cli\u003emain menu for all consoles in GUI version\u003c/li\u003e    \r\n  \u003cli\u003eModbus register number/address converter utility (in your own scripting language)\u003c/li\u003e  \r\n  \u003cli\u003eNumber converter utility (in your own scripting language)\u003c/li\u003e  \r\n  \u003cli\u003emodified source code structure of XModshell\u003c/li\u003e    \r\n  \u003cli\u003enew command `chkdevlock`/`rmdevlock` (only *nix systems)\u003c/li\u003e    \r\n  \u003cli\u003enew command `datatype`\u003c/li\u003e    \r\n  \u003cli\u003enew command `exist`\u003c/li\u003e    \r\n  \u003cli\u003enew command `inputmeth`\u003c/li\u003e    \r\n  \u003cli\u003enew command `macro`\u003c/li\u003e  \r\n  \u003cli\u003enew command `mbconv`\u003c/li\u003e    \r\n  \u003cli\u003enew command `mbmon`\u003c/li\u003e    \r\n  \u003cli\u003enew command `printcolor`(only CLI and TUI)\u003c/li\u003e    \r\n  \u003cli\u003enew command `runmeth`\u003c/li\u003e    \r\n  \u003cli\u003enew command `sendmeth`\u003c/li\u003e    \r\n  \u003cli\u003enew command `tcpcons`, `tcpread`, `tcpwrite`\u003c/li\u003e    \r\n  \u003cli\u003enew command `udpcons`, `udpread`, `udpwrite`\u003c/li\u003e    \r\n  \u003cli\u003enew commands `ioread` and `iowrite`\u003c/li\u003e  \r\n  \u003cli\u003enew menu items in the main menu for quick execution of Modbus R/W commands\u003c/li\u003e    \r\n  \u003cli\u003enew menu items for show and edit all register's value in a big table\u003c/li\u003e    \r\n  \u003cli\u003enew serial baudrates: 150, 300, 600 baud\u003c/li\u003e  \r\n  \u003cli\u003eserial echo server utility for testing connectivity\u003c/li\u003e    \r\n  \u003cli\u003eserial ModBus traffic monitor utility\u003c/li\u003e  \r\n  \u003cli\u003esupport for variable and constant arrays\u003c/li\u003e    \r\n  \u003cli\u003enew predefined constants\u003c/li\u003e  \r\n  \u003cli\u003esyntax highlighter file for applications using GTKSourceView (for example: Builder, Geany, Gedit, Mousepad, Pluma, Scribes), for Notepad++ (Windows only) and Vim/Neovim\u003c/li\u003e  \r\n  \u003cli\u003eTCP and UPD echo server utilities for testing connectivity.\u003c/li\u003e  \r\n \u003c/ul\u003e  \r\n Only a source package will be released.\r\n\u003c/details\u003e\r\n \r\n\u003cdetails\u003e\r\n \u003csummary\u003e\u003ci\u003ev0.1-alpha3\u003c/i\u003e\u003c/summary\u003e  \r\n \u003ci\u003eThird and last developer test release\u003c/i\u003e with the following changes:\r\n \u003cul\u003e\r\n  \u003cli\u003eNew source code directory structure;\u003c/li\u003e\r\n  \u003cli\u003enew commands;\u003c/li\u003e\r\n  \u003cli\u003enew predefined constants;\u003c/li\u003e\r\n  \u003cli\u003ebug fixes;\u003c/li\u003e\r\n  \u003cli\u003eGUI (except DOS);\u003c/li\u003e\r\n  \u003cli\u003escript syntax highlighting file for MCEdit and Nano.\u003c/li\u003e\r\n \u003c/ul\u003e\r\n Only a source package will be released.  \r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n \u003csummary\u003e\u003ci\u003ev0.1-alpha2\u003c/i\u003e\u003c/summary\u003e\r\n \u003ci\u003eSecond developer test release\u003c/i\u003e with the following changes:\r\n \u003cul\u003e\r\n  \u003cli\u003eBug fixes;\u003c/li\u003e\r\n  \u003cli\u003eModbus/ASCII and Modbus/RTU communication;\u003c/li\u003e\r\n  \u003cli\u003ehandling of constants;\u003c/li\u003e\r\n  \u003cli\u003ethree predefined constants and\u003c/li\u003e\r\n  \u003cli\u003e28 new command (total: 94);\u003c/li\u003e\r\n  \u003cli\u003escript syntax highlighting file for Micro.\u003c/li\u003e\r\n \u003c/ul\u003e\r\n All types of binary and installation packages will be released along with the\r\n source package.  \r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n \u003csummary\u003e\u003ci\u003ev0.1-alpha1\u003c/i\u003e\u003c/summary\u003e\r\n \u003ci\u003eFirst developer test release\u003c/i\u003e is not yet suitable for work, although it is\r\n functional, but it can only communicate via Modbus/ASCII. The purpose of this\r\n release is to test the program's construction, operation, packaging, and package\r\n installation in all supported environments. In addition, the documentation and\r\n other files are checked for possible typos and errors. Only a source package\r\n will be released.  \r\n\u003c/details\u003e\r\n\r\n## III. Screenshots\r\n\r\n### ModShell  \r\n\r\nNormal command line\r\n![CLI](document/picture/modshell.png)\r\n\r\nFullscreen command line\r\n![TUI](document/picture/modshell-f.png)\r\n\r\nRun example script on bash with ModShell interpreter\r\n![script running](document/picture/modshell-r.png)\r\n\r\n### XModShell  \r\n\r\nDump input registers  \r\n![dump input registers](document/picture/xmodshell-dump.png)\r\n\r\nInput registers in Register table  \r\n![register table](document/picture/xmodshell-regtable.png)\r\n\r\nMini serial console  \r\n![mini serial console](document/picture/xmodshell-sercons.png)\r\n\r\nScript editor  \r\n![script editor](document/picture/xmodshell-edit.png)\r\n\r\nVariable monitor  \r\n![variable monitor](document/picture/xmodshell-varmon.png)\r\n\r\n## IV. Used external libraries and programs\r\n\r\n - _Ararat Synapse Release 40_ [^1]  \r\n   TCP/IP and serial library for FreePascal  \r\n   Modified BSD style license, Copyright (C) 1999-2012 Lukas Gebauer  \r\n - _Convert - Bin/Oct/Dec/Hex number converter_  \r\n   Unit for Turbo Pascal v3.0  \r\n   Public Domain, Copyright (C) 1993 Tom Wellige  \r\n - _InpOut32 v1.0.07 Driver Interface DLL_ [^2]  \r\n   Windows Dynamic Link Library (DLL)  \r\n   Open source/freeware  \r\n   Copyright (C) 2003-2015 Phil Gibbons  \r\n   Copyright (C) 2000 \u003clogix4u.net\u003e  \r\n - _LHelp v2021-02-12 CHM help viewer_  \r\n   Application  \r\n   GNU GPL v2.0 or later, Copyright (C) 2005-2014 Andrew Haines, Lazarus contributors  \r\n - _ProtCOM v0.1 Protected mode serial port handler for DOS_ [^3]  \r\n   Unit for FreePascal  \r\n   Creative Common Zero Universal v1.0, Copyright (C) 2024 Pozsar Zsolt  \r\n\r\n## V. About the program in a nutshell\r\n\r\nThis is a utility that can be used on several operating systems, which can\r\ncommunicate with connected equipment using Modbus/ASCII,\r\nModbus/RTU and Modbus/TCP protocols [^4]. The basic communication protocol\r\nof the program is Modbus, but DCON  and HART was also implemented due to\r\ncommunication with other devices. The range of foreign protocols may be expanded\r\nlater. The program can - even automatically - read, write or copy data from one\r\ndevice to another (e.g. transferring settings). When copying, the source and\r\ndestination register areas can be different.\r\n\r\nThe ModShell program has a *traditional (CLI)* or *full-screen (TUI) command-line*\r\ninterface and is also *suitable for running pre-created scripts* independently\r\n(as a command interpreter). The program provides help on the commands that can\r\nbe used, and offers possible values when the parameters are entered incorrectly.\r\nThe issued commands are placed in history, which can be browsed with the up/down\r\narrow keys.\r\n\r\nThe XModShell program has a *graphical interface (GUI)*, which helps to perform\r\nseveral operations with dialog windows, but the original command line input\r\nremained available for them (e.g. file selection, settings, etc.) [^5].\r\n\r\n### Operating principle  \r\n\r\nIt must be defined the I/O devices, then the protocols and the connections.\r\nThere can be eight of each. The data traffic takes place between the preset\r\nconnections. In all cases, the data is sent to or read from the internal buffer.\r\nThe size of the buffer is suitable for storing 2*9999 logical and word values of\r\nthe same size.\r\n\r\n128 variables and 32 arrays (which can also be constants) can be created in\r\nthe program, to which we can assign a value of any type (eg.: string, boolean\r\nor integer register value, real number, etc.). Variables and constants can be\r\nused to perform logical and arithmetical operations, and can be used to pass\r\nvalues to commands.\r\n\r\nIt is possible to create 32 single-line macros to replace frequently used longer\r\ncommands. The program includes 3 pre-created macros, the content of which can\r\nalso be changed.\r\n\r\n### Projects  \r\n\r\nIn the program, you can create projects for easier management of settings and\r\ndata. The name of the current project is shown in the prompt. The project\r\ndirectory will be created in the program directory on DOS, and in the ModShell\r\ndirectory in the user's home directory on all other systems. If only filename\r\nis specified during file operations (without path), this directory will be the\r\nsource/destination directory.\r\n\r\n### File operations  \r\n\r\nThe command line history can be exported to a text file and provides it with\r\nthe appropriate 'shebang' for the installation method and operating system. You\r\ncan easily create a script from this raw file.\r\n\r\nDevice, protocol and connection settings can be saved and loaded in their own\r\nformat. During saving, three typed files are created, with the following\r\nextensions: DDT, PDT, CDT.\r\n\r\nAll register values can be saved and loaded in their own format. During saving,\r\ntwo typed files are created, with the following extensions: BDT, IDT.\r\n\r\nOne or more same type registers can be exported to file. During saving, one text\r\nfile is created, with CSV, INI or XML extension. The program can only import\r\nfrom INI and XML format files.\r\n\r\nWe can also create time-stamped log entries with the program and or script.\r\n\r\nOn exit, the command line history, input and echo mode and colors are preserved.\r\n\r\nThe program also has basic file and directory management commands.\r\n\r\n### Script operations  \r\n\r\nThe script on the disc can be loaded into the already running program and\r\nstarted manually.\r\n\r\nThe loaded script can be edited with a line editor, saved to disk or\r\ndeleted from the buffer. The graphical version has a simple editor window\r\nwith syntax highlighting instead of the line editor.\r\n\r\nVariables, constants and macros defined before running the script will be\r\ndeleted. It is also possible to observe the values of up to four variables\r\nduring runtime and to keep the final values​of constants and variables created\r\nduring runtime.\r\n\r\nIn interpreter mode, operating system command line arguments are available as\r\npredefined constants.\r\n\r\n### Raw serial connection  \r\n\r\nThe program provides the possibility to send and receive raw data via a\r\nserial port, and also includes a very simple serial console. The display of sent\r\nand received data can be turned off or raw text and hexadecimal viewing can be\r\nselected.\r\n\r\n### Serial connection with DCON protocol  \r\n\r\nThe program also provides the possibility to send and receive data with DCON\r\nprotocol via a serial port.\r\n\r\n### Serial connection with HART protocol  \r\n\r\nThe program also provides the possibility to send and receive data with HART\r\nprotocol via a serial port. A serial/HART gateway may be required for connection.\r\n\r\n### Raw TCP connection  \r\n\r\nThe program provides the possibility to send and receive raw data via network\r\ndevice with TCP, and also includes a very simple TCP console. The display of\r\nsent and received data can be turned off or raw text and hexadecimal viewing\r\ncan be selected.\r\n\r\n### Raw UDP connection  \r\n\r\nThe program provides the possibility to send and receive raw data via network\r\ndevice with UDP, and also includes a very simple UDP console. The display of\r\nsent and received data can be turned off or raw text and hexadecimal viewing\r\ncan be selected.\r\n\r\n### Direct I/O access  \r\n\r\nThe program provides direct, byte-sized reading and writing of hardware I/O\r\nports on PCs and bit-sized reading and writing GPIO ports on Raspberry Pi and\r\nIndustrial PCs. On Windows operating systems, it uses the included external\r\ndynamically linked library.  \r\n\r\n## VI. Implemented commands  \r\n\r\n|   |command     |category     |hotkey  |description                                                          |\r\n|--:|:----------:|:-----------:|:------:|---------------------------------------------------------------------|\r\n|  1|`abs`       |arithmetic   |        |absolute value                                                       |\r\n|  2|`add`       |arithmetic   |        |addition                                                             |\r\n|  3|`avg`       |arithmetic   |        |average calculation                                                  |\r\n|  4|`conv`      |arithmetic   |ALT-C   |convert numbers between BIN, DEC, HEX and OCT format                 |\r\n|  5|`cos`       |arithmetic   |        |cosine function                                                      |\r\n|  6|`cotan`     |arithmetic   |        |cotangent function                                                   |\r\n|  7|`dec`       |arithmetic   |        |decrement integer                                                    |\r\n|  8|`div`       |arithmetic   |        |division                                                             |\r\n|  9|`exp`       |arithmetic   |        |natural exponential                                                  |\r\n| 10|`idiv`      |arithmetic   |        |integer division                                                     |\r\n| 11|`imod`      |arithmetic   |        |modulus division                                                     |\r\n| 12|`inc`       |arithmetic   |        |increment integer                                                    |\r\n| 13|`inrange`   |arithmetic   |        |check the value is in the range                                      |\r\n| 14|`ln`        |arithmetic   |        |natural logarithm                                                    |\r\n| 15|`mul`       |arithmetic   |        |multiplication                                                       |\r\n| 16|`mulinv`    |arithmetic   |        |multiplicative inverse                                               |\r\n| 17|`odd`       |arithmetic   |        |odd or event                                                         |\r\n| 18|`pow2`      |arithmetic   |        |exponentiation of two                                                |\r\n| 19|`pow`       |arithmetic   |        |exponentiation                                                       |\r\n| 20|`prop`      |arithmetic   |        |propotional value calculation (with zero and span)                   |\r\n| 21|`rnd`       |arithmetic   |        |create random integer                                                |\r\n| 22|`round`     |arithmetic   |        |round real number                                                    |\r\n| 23|`sin`       |arithmetic   |        |sine function                                                        |\r\n| 24|`sqr`       |arithmetic   |        |square                                                               |\r\n| 25|`sqrt`      |arithmetic   |        |square root                                                          |\r\n| 26|`sub`       |arithmetic   |        |substraction                                                         |\r\n| 27|`swp`       |arithmetic   |        |swap value of two variables                                          |\r\n| 28|`tan`       |arithmetic   |        |tangent function                                                     |\r\n| 29|`copyreg`   |communication|        |copy one or more remote registers between two connections            |\r\n| 30|`dcon`      |communication|        |read or write data from/to remote device with DCON protocol          |\r\n| 31|`hart`      |communication|        |read or write data from/to remote device with HART protocol          |\r\n| 32|`mbconv`    |communication|        |Modbus register number/address converter                             |\r\n| 33|`mbgw`      |communication|        |start internal Modbus gateway                                        |\r\n| 34|`mbsrv`     |communication|        |start internal Modbus slave/server                                   |\r\n| 35|`mbmon`     |communication|        |start serial Modbus traffic monitor                                  |\r\n| 36|`readreg`   |communication|ALT-R   |read one or more remote registers                                    |\r\n| 37|`sercons`   |communication|F7      |mini serial console                                                  |\r\n| 38|`serread`   |communication|        |read string from a serial device                                     |\r\n| 39|`serwrite`  |communication|        |write string to a serial device                                      |\r\n| 40|`tcpcons`   |communication|SHIFT-F7|mini TCP console                                                     |\r\n| 41|`tcpread`   |communication|        |read string over the network using TCP                               |\r\n| 42|`tcpwrite`  |communication|        |write string over the network using TCP                              |\r\n| 43|`udpcons`   |communication|        |mini UDP console                                                     |\r\n| 44|`udpread`   |communication|        |read string over the network using UDP                               |\r\n| 45|`udpwrite`  |communication|        |write string over the network using UDP                              |\r\n| 46|`writereg`  |communication|ALT-W   |write data to one or more remote registers                           |\r\n| 47|`get`       |configuration|ALT-G   |get device, protocol, connection, colors, project name and timeout   |\r\n| 48|`reset`     |configuration|ALT-T   |reset device, protocol or connection or reset project name           |\r\n| 49|`set`       |configuration|ALT-S   |set device, protocol, connection, colors, project name and timeout   |\r\n| 50|`applog`    |file         |        |append a record to log file (LOG)                                    |\r\n| 51|`exphis`    |file         |        |export command line history to file (TXT)                            |\r\n| 52|`expreg`    |file         |ALT-E   |export one or more registers to file (CSV, INI, XML)                 |\r\n| 53|`impreg`    |file         |ALT-I   |import one or more registers from file (INI, XML)                    |\r\n| 54|`loadcfg`   |file         |F3      |load settings of device, protocol and connection (?DT)               |\r\n| 55|`loadreg`   |file         |F5      |load all buffer registers from typed file (?DT)                      |\r\n| 56|`savecfg`   |file         |F2      |save settings of device, protocol and connection (?DT)               |\r\n| 57|`savereg`   |file         |F4      |save all registers to typed file (?DT)                               |\r\n| 58|`arrclear`  |general      |        |clear content of an array                                            |\r\n| 59|`arrfill`   |general      |        |fill an array with a character                                       |\r\n| 60|`ascii`     |general      |        |show ASCII table                                                     |\r\n| 61|`beep`      |general      |        |make a beep with internal speaker                                    |\r\n| 62|`carr`      |general      |        |show all constant arrays with theirs size or define a new one        |\r\n| 63|`cls`       |general      |F8      |clear screen                                                         |\r\n| 64|`const`     |general      |        |show all constants with theirs value or define a new one             |\r\n| 65|`cron`      |general      |        |loaded script scheduled execution                                    |\r\n| 66|`datatype`  |general      |        |detect type of data                                                  |\r\n| 67|`date`      |general      |        |show system date and time                                            |\r\n| 68|`echometh`  |general      |F9      |alphanumerical/hexadecimal/none local echo method for connections    |\r\n| 69|`exit`      |general      |F10     |exit                                                                 |\r\n| 70|`for`       |general      |        |loop iteration                                                       |\r\n| 71|`getarrsize`|general      |        |get size of an array                                                 |\r\n| 72|`goto`      |general      |        |jump to specified label                                              |\r\n| 73|`help`      |general      |F1      |show description or usage of the commands                            |\r\n| 74|`if`        |general      |        |selection statement                                                  |\r\n| 75|`input`     |general      |        |input data from console                                              |\r\n| 76|`inputmeth` |general      |SHIFT-F9|alphanumerical/hexadecimal data input method for connections         |\r\n| 77|`label`     |general      |        |define label (for goto command)                                      |\r\n| 78|`let`       |general      |ALT-L   |set value of a register, variable, a constant or an element of array |\r\n| 79|`macro`     |general      |        |show all macros with theirs value or define a new one                |\r\n| 80|`pause`     |general      |        |waits for a keystroke or specified time                              |\r\n| 81|`pipe`      |general      |        |use an variable array as a FIFO storage                              |\r\n| 82|`printcolor`|general      |        |set temporary foreground and background colors for print in CLI/TUI  |\r\n| 83|`print`     |general      |ALT-P   |print message, value of the variable and register                    |\r\n| 84|`runmeth`   |general      |        |get execution method                                                 |\r\n| 85|`sendmeth`  |general      |CTRL-F9 |char-to-char or string data send method for connections              |\r\n| 86|`setarrsize`|general      |        |set size of an array                                                 |\r\n| 87|`stack`     |general      |        |use an variable array as a LIFO storage                              |\r\n| 88|`var`       |general      |        |show all variables with theirs value or define a new one             |\r\n| 89|`varmon`    |general      |ALT-M   |monitoring the value of variables                                    |\r\n| 90|`varr`      |general      |        |show all variable arrays with theirs size or define a new one        |\r\n| 91|`ver`       |general      |        |show version and build information of this program                   |\r\n| 92|`and`       |logic        |        |AND logical operations                                               |\r\n| 93|`bit`       |logic        |        |value of the specified bit                                           |\r\n| 94|`not`       |logic        |        |NOT logical operations                                               |\r\n| 95|`or`        |logic        |        |OR logical operations                                                |\r\n| 96|`roll`      |logic        |        |roll bit of integer to left                                          |\r\n| 97|`rolr`      |logic        |        |roll bit of integer to right                                         |\r\n| 98|`shl`       |logic        |        |bit shift to left                                                    |\r\n| 99|`shr`       |logic        |        |bit shift to right                                                   |\r\n|100|`xor`       |logic        |        |XOR logical operations                                               |\r\n| 91|`dump`      |register     |F6      |dump all registers in binary/hexadecimal format to a table           |\r\n| 92|`edit`      |script       |SHIFT-F4|edit loaded script with line editor                                  |\r\n| 93|`erasescr`  |script       |SHIFT-F8|erase script from buffer                                             |\r\n|104|`list`      |script       |F11     |list loaded script                                                   |\r\n|105|`loadscr`   |script       |SHIFT-F3|load ModShell scriptfile from disc                                   |\r\n|106|`run`       |script       |F12     |run loaded script                                                    |\r\n|107|`savescr`   |script       |SHIFT-F2|save loaded script to disc                                           |\r\n|108|`chr`       |string       |        |convert byte to char                                                 |\r\n|109|`concat`    |string       |        |concatenate strings                                                  |\r\n|110|`length`    |string       |        |length of string                                                     |\r\n|111|`lowcase`   |string       |        |conversion to lowercase                                              |\r\n|112|`mkcrc`     |string       |        |make CRC value                                                       |\r\n|113|`mklrc`     |string       |        |make LRC value                                                       |\r\n|114|`ord`       |string       |        |convert char to byte                                                 |\r\n|115|`strdel`    |string       |        |delete specified element(s) of the string                            |\r\n|116|`strfind`   |string       |        |find specified element in the string                                 |\r\n|117|`strins`    |string       |        |insert element into string                                           |\r\n|118|`stritem`   |string       |        |specified element of the string                                      |\r\n|119|`strrepl`   |string       |        |replace element in the string                                        |\r\n|120|`upcase`    |string       |        |conversion to uppercase                                              | \r\n|121|`cd`        |system       |        |change actual directory                                              |\r\n|122|`chkdevlock`|system       |        |check device lock file                                               |\r\n|123|`copy`      |system       |        |copy file                                                            |\r\n|124|`del`       |system       |        |remove file                                                          |\r\n|125|`dir`       |system       |        |list directory content                                               |\r\n|126|`exist`     |system       |        |existence of a file or directory                                     |\r\n|127|`gpioinit`  |system       |        |initialize GPIO port                                                 |\r\n|128|`gpioread`  |system       |        |read a bit from a GPIO port                                          |\r\n|129|`gpiowrite` |system       |        |write a bit to a GPIO port                                           |\r\n|130|`ioread`    |system       |        |read a byte from an I/O port                                         |\r\n|131|`iowrite`   |system       |        |write a byte to an I/O port                                          |\r\n|132|`md`        |system       |        |make directory                                                       |\r\n|133|`rd`        |system       |        |remove directory                                                     |\r\n|134|`ren`       |system       |        |rename file                                                          |\r\n|135|`rmdevlock` |system       |        |remove device lock file                                              |\r\n|136|`type`      |system       |        |type file                                                            |\r\n\r\n(Commands with function keys (F?) are executed immediately, modifier keys\r\n(ALT-?) only make typing easier.)  \r\n\r\n## VII. Predefined things\r\n\r\n### Predefined variables  \r\n\r\n|name    |value                                      |\r\n|:-------|:------------------------------------------|\r\n|$verbose|verbosity level (values: NOTHING|ERROR|ALL)|\r\n\r\nEmpty and any other variable value are equivalent to ALL.\r\n\r\n### Predefined constants  \r\n\r\n|name    |value                                                     |\r\n|:-------|:---------------------------------------------------------|\r\n|$?      |exit value of the commands                                |\r\n|$ARGx   |OS command line arguments (interpreter mode)              |\r\n|$ARGCNT |number of the OS command line arguments (interpreter mode)|\r\n|$B01    |150 (baud)                                                |\r\n|$B03    |300 (baud)                                                |\r\n|$B06    |600 (baud)                                                |\r\n|$B1     |1200 (baud)                                               |\r\n|$B2     |2400 (baud)                                               |\r\n|$B4     |4800 (baud)                                               |\r\n|$B9     |9600 (baud)                                               |\r\n|$B19    |19200 (baud)                                              |\r\n|$B38    |38400 (baud)                                              |\r\n|$B57    |57600 (baud)                                              |\r\n|$B115   |115200 (baud)                                             |\r\n|$EULER  |value of e (2.7182818284590452354)                        |\r\n|$HOME   |user's home directory                                     |\r\n|$PI     |value of Pi (3.1415926535897932385)                       |\r\n|$PRJDIR |directory of the actual project                           |\r\n|$PRJNAME|name of the actual project                                |\r\n|$SQRT2  |value of square root of 2                                 |\r\n|$SQRT3  |value of square root of 3                                 |\r\n\r\n### Predefined macros  \r\n\r\n|name    |value                               |\r\n|:-------|:-----------------------------------|\r\n|mydev0  |set dev0 set /dev/ttyUSB0 9600 8 n 1|\r\n|mypro0  |set pro0 rtu 1                      |\r\n|mycon0  |set con0 dev0 pro0                  |\r\n\r\nThese macros can also be changed.\r\n\r\n## VIII. Documentation and Help  \r\n\r\nModshell and XModShell has a minimal built-in help which you can access by\r\ntyping help. Additionally, you can view the manual page from *nix shell\r\n(_man modshell_) or _modshell.txt_ on other systems.  \r\n\r\nIn the graphical version, you can use Help and Online Wiki can be opened directly\r\nfrom the 'Help' menu.  \r\n\r\n## IX. Contributing  \r\n\r\nIf you find any bugs, please report them! I am also happy to accept pull\r\nrequests from anyone. You can use the GitHub issue tracker to report bugs, ask\r\nquestions, or suggest new features. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)\r\nfor details.  \r\n\r\n## X. Links  \r\n\r\n - [Homepage](http://www.pozsarzs.hu)  \r\n - [GitHub repository](https://github.com/pozsarzs/modshell)  \r\n - [Project webpage on Github](https://pozsarzs.github.io/modshell)  \r\n - [Online manual on Github](https://github.com/pozsarzs/modshell/wiki)  \r\n\r\n### Source packages  \r\n\r\n|name                                                                                                    |version    |\r\n|--------------------------------------------------------------------------------------------------------|:---------:|\r\n|[main.zip](https://github.com/pozsarzs/modshell/archive/refs/heads/main.zip)                            |latest     |\r\n|[modshell-0.1beta1.tar.gz](http://www.pozsarzs.hu/packages/software/modshell/modshell-0.1beta1.tar.gz)|v0.1-beta1|\r\n|[modshell-0.1alpha3.tar.gz](http://www.pozsarzs.hu/packages/software/modshell/modshell-0.1alpha3.tar.gz)|v0.1-alpha3|\r\n|[modshell-0.1alpha2.tar.gz](http://www.pozsarzs.hu/packages/software/modshell/modshell-0.1alpha2.tar.gz)|v0.1-alpha2|\r\n|[modshell-0.1alpha1.tar.gz](http://www.pozsarzs.hu/packages/software/modshell/modshell-0.1alpha1.tar.gz)|v0.1-alpha1|\r\n\r\n### Binaries and installer packages for several OS and architecture\r\n\r\nNot all test versions have binary or installation packages.\r\nTo download, visit [Modshell's webpage](http://www.pozsarzs.hu/software/modshell_en.html).\r\n\r\n[^1]: [Synapse Github repository](https://github.com/geby/synapse)\r\n[^2]: [InpOut32 Github repository](https://github.com/ellysh/InpOut32)\r\n[^3]: [ProtCOM Github repository](https://github.com/pozsarzs/protcom)\r\n[^4]: [Modbus](https://modbus.org)\r\n[^5]: [Wiki - Differents between CUI and GUI version](https://github.com/pozsarzs/modshell/wiki/c.-Differents-between-CUI-and-GUI-version)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpozsarzs%2Fmodshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpozsarzs%2Fmodshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpozsarzs%2Fmodshell/lists"}