Getting started¶
Requirements¶
- an Ethernet MSCB submaster reachable by hostname or IPv4 address;
- one or more powered MSCB nodes on its RS-485 bus;
- Python 3.9 or newer for the Python tools, or a built C++
mscexecutable; - the optional password configured on the submaster.
The default UDP port is 1177. The Python tools also accept host:port; the
C++ msc executable uses the configured MSCB default port.
Use the Python CLI¶
From the repository root:
By IP address:
Run one command and exit:
No pip installation is required for mscb.py: msc.py imports the sibling
module directly.
Build and run the msc executable¶
The interactive C++ client is implemented in src/msc.cxx. It is built as the
msc executable together with the C MSCB library implementation, command-line
editor, and XML support. The source file itself is not run directly.
You need CMake 3.10 or newer and a C++17 compiler. From the repository root,
configure and compile the msc target:
With a single-configuration generator on Linux or macOS, the executable is:
or, using an IP address:
For Visual Studio and other multi-configuration generators, select a build configuration and run the executable from that configuration directory:
Once connected, enter commands at the prompt:
To select a node, execute one command, and exit immediately:
To discover Ethernet submasters without opening an interactive session:
The executable can optionally be installed. This example keeps the installation inside the repository:
See the msc command reference for all startup options
and interactive commands.
Find submasters and nodes¶
Discover Ethernet submasters on the local network:
After connecting, scan likely node addresses:
Use scan a for all 65,536 addresses; this is much slower than the optimized
default scan.
Inspect and operate a node¶
read without an index reads all available variables except hidden variables.
Use read a to include hidden variables.
Save and restore configuration¶
The save file contains node identity and variable values in XML. Loading maps variables by name, so it can tolerate index changes when names remain stable. The tool asks whether loaded values should be flashed to non-volatile memory.
Firmware operations¶
Supported formats depend on the target and implementation and include Intel HEX, Xilinx BIT, S-record, and binary images. Firmware operations can make a node temporarily unavailable. Confirm target address, subaddress, image type, and power stability before proceeding.
Flash and address operations change persistent state
flash, sa, sg, sn, baud, and firmware commands alter node or
submaster configuration. Verify the selected target first with info.
Minimal Python application¶
import mscb
with mscb.MSCB("mscb123") as bus:
if not bus.ping(1):
raise RuntimeError("node 1 did not respond")
raw = bus.read(1, 0)
print(raw)
For a C-style call sequence in Python, initialize an fd and call module
functions such as mscb.mscb_ping(fd, 1) directly.
For C applications, see C library. For every CLI
command and option, see msc command reference.