Architecture¶
flowchart LR
A["Host application<br/>C, C++, Python, or msc"]
B["Ethernet submaster<br/>UDP port 1177"]
C["RS-485 segment<br/>9-bit addressing"]
D["Node 0…65535"]
E["Node variables<br/>measurements and settings"]
A -->|"MSCB library API"| B
B -->|"MSCB command payload"| C
C --> D
D --> E
Host and submaster¶
The host library builds MSCB commands, manages retries, and sends them to a submaster. The Ethernet implementation wraps each RS-485 transaction in a small UDP header containing payload size, sequence number, flags, and protocol version. The submaster applies the requested ninth-bit and timing behavior to the physical bus and returns the node response.
Addressing¶
Every node has a 16-bit node address and a 16-bit group address. A master can select:
- one node, for commands that may return a response;
- a group, for simultaneous no-acknowledge writes; or
- all nodes by broadcast.
Address 0xFFFF is the factory/unconfigured node address. New nodes can be
found there and assigned a permanent address. Address commands are transmitted
with serial bit 9 set; ordinary commands have bit 9 clear.
Self-documenting variables¶
A node exposes as many as 256 variables. Each variable has an index, width,
name, unit, SI prefix, status, and flags describing such properties as floating
point, signedness, hidden configuration, or remote routing. Clients query this
metadata with MCMD_GET_INFO, then encode values appropriately.
Variables live in node RAM. MCMD_FLASH asks the node to copy its current
values and configuration to non-volatile storage. Because EEPROM has limited
write endurance, flashing should be deliberate rather than automatic after
every write.
Master/slave behavior¶
The ordinary protocol is master/slave: only an addressed node responds. Group
and broadcast requests must not provoke multiple responses, because that would
cause an RS-485 collision. MCMD_TOKEN is reserved for a token-ring
arrangement when multiple masters share a bus.
Data paths¶
| Operation | Command family | Typical use |
|---|---|---|
| Discover | PING8, PING16 |
Test whether an address responds |
| Describe | GET_INFO |
Read node and variable metadata |
| Read | READ, READ_RANGE |
Acquire one or several variables |
| Write | WRITE_NA, WRITE_ACK, WRITE_RANGE |
Set variables |
| Persist | FLASH |
Copy current configuration to EEPROM/flash |
| Memory transfer | READ_MEM, WRITE_MEM |
Firmware and block access |
| Diagnostics | ECHO, GET_UPTIME, LOG |
Verify and inspect operation |