|
Motion Master 6.0.0-alpha.50
Next-generation motion control software
|
#include <array>#include <cstdint>#include <expected>#include <functional>#include <ostream>#include <string>#include <vector>#include "node/process_data_ring.h"Go to the source code of this file.
Classes | |
| struct | mm::node::DumpPdoEntry |
| One PDO-mapped object as recorded in the dump header. More... | |
| struct | mm::node::DumpDevice |
| One device's identity and the PDO objects it contributes to the image. More... | |
| struct | mm::node::DumpHeader |
| The embedded process-image header: everything needed to decode the rows offline. More... | |
Namespaces | |
| namespace | mm |
| namespace | mm::node |
Typedefs | |
| using | mm::node::DumpRecordReader = std::function< bool(uint64_t seq, ProcessDataRing::Record &out)> |
Reads the record for seq into out; returns false if it is no longer available (lapped or a torn read). Wraps ProcessDataRing::readRecord. | |
Functions | |
| std::expected< uint64_t, std::string > | mm::node::writeProcessDataDump (std::ostream &out, const DumpHeader &header, uint64_t startSeq, uint64_t endSeq, const DumpRecordReader &read) |
Serialises the frozen span [startSeq, endSeq) to out as a .mmpd dump. | |
Variables | |
| constexpr std::array< char, 4 > | mm::node::kDumpMagic = {'M', 'M', 'P', 'D'} |
| Magic at the very start of every dump file. | |
| constexpr uint16_t | mm::node::kDumpFormatVersion = 1 |
| Current dump format version. A reader rejects an unknown major shape; bump on layout changes so old files stay identifiable. | |
| constexpr std::streamoff | mm::node::kDumpRowCountOffset = 16 |
Byte offset of the rowCount field within the fixed prefix. The writer streams rows first, then seeks here to patch the final count — so the stream must be seekable. | |
The .mmpd binary dump of the process-data recorder: exactly what the recorder ring holds (full raw inputs + outputs for every cycle in a frozen span) plus the process image embedded as a header, so a run decodes fully offline — no running Motion Master and no live bus.
Layout (all multi-byte integers little-endian):
File prefix (fixed 36 bytes — rowCount sits at a fixed offset so it can be patched after the rows are streamed): 0 char magic[4] = 'M','M','P','D' 4 u16 formatVersion = kDumpFormatVersion 6 u16 flags = 0 (reserved) 8 u64 startSequence (sequence of the first row; oldest cycle in the span) 16 u64 rowCount (number of rows actually written) <- patched at the end 24 u32 inputBytes (per-row input region size) 28 u32 outputBytes (per-row output region size) 32 u32 deviceCount Device table (deviceCount entries): u16 slavePosition u32 vendorId · u32 productCode · u32 revisionNumber · u32 serialNumber str name (u16 length + UTF-8 bytes) u32 entryCount per PDO entry: u16 index · u8 subindex · u8 direction (1 = output/RxPDO, 0 = input/TxPDO) u16 dataType (0 = unknown) · u16 bitLength · u32 bitOffset str name (empty when the object dictionary is not enumerated) Rows (rowCount entries, fixed stride 16 + inputBytes + outputBytes): u64 sequence · u64 timestampNs · u8 inputs[inputBytes] · u8 outputs[outputBytes]
A row's input/output regions are padded with zeros (or truncated) to the header sizes, so the stride is fixed and a reader can index any cycle directly. The timestamp keeps full epoch-ns precision (unlike the live monitoring row, which reduces it to microseconds for JavaScript).