Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
MTB library wiki
This wiki describes functionality of MTB.dll dynamic library and its API.
MTB library is used to set and get state of MTB modules on model railroad via simple dll interface. It supports MTB-UNI and MTB-TTL modules with firmware 4.1.
This library could be loaded from any program (be sure to match library and application architecture [e.g. x86 or x86-64]). MTB.dll is currently distributed only in x86 (32-bit) architecture.
The library is implemented in Object Pascal and usually being compiled in Delphi 2009 32-bit.
The library has windows, however, it is fully operable without using them.
- Fully operable MTB-USB module connected to PC via USB.
- MTB-USB driver (available in project releases). Driver is custom FTDI driver, installation from unknown sources is required to install this driver.
Short intro to MTB
- MTB is a RS485-based bus which consists of a single master (called MTB-USB) and multiple slaves.
- There are several types of slaves, each has different features:
- Most common modules are MTB-UNI and MTB-TTL.
- Both of these modules have 16 digital inputs and 16 digital outputs.
- This library supports only MTB-UNI, MTB-UNIm and MTB-TTL.
- This library allows user to detect states of inputs and set states of outputs.
- Each board has its unique address, 1-255.
- There are 16 input and 16 output ports on each MTB-UNI, MTB-UNIm or MTB-TLL board, these pins are indexed 0-15.
- Connect MTB-USB board via USB.
- Install drivers.
- Load the library into you program.
- Select one of available MTB-USB boards.
- Open device (by calling
Openfrom your app, wait for modules being scanned).
- Optional: configure modules (configuration will be saved).
- Start communication (by calling
Startfrom your app).
- Use the bus (
- Stop communication by calling
- Close device by calling
API specification is available here.
Configuration file specification
Library configuration file specification is available here.
- When initialized, library tries to load default configuration file
- Logging can be enabled/disabled in configuration file.
- Library automatically saves its configuration into
This software is distributed as open source under Apache License v2.0.
This library bases on MTB component for Delphi created by Petr Travnik.
This library was created by: