Format - HeribertHechtersheim/Z-CodeReverseEngineering GitHub Wiki
Wiki ▸ [Z-Code Documentation](Z Code Documentation) ▸ File Format
A .zcode file consists of a header, which contains all the information the printer displays in the print menu (time, material...) followed by a list of commands the printer will execute during printing.
Header
The header is block of 128 bytes at the beginning of the file. The first 16 bytes contain the ascii characters of "ZCode" followed by zeros:
5A 43 6F 64 65 00 00 00 00 00 00 00 00 00 00 00
Offset (Hex) | Type | Content |
---|---|---|
00 | char[5] | ASCII Characters of "ZCode" |
10 | byte[38] | unknown |
36 | int32_t | Printing time in seconds. Chaotic behaviour: Negative values will start the print automatically |
3A | byte[4] | unknown |
3E | int8_t | Printing Material: 0 - "Z-ABS", 1 - "Z-Ultrat", 2 - "Z-Glass", 3 - "Z-HIPS", 4 - "Z-PCABS", 5 - "Z-PETG", else: "" |
3F | byte[63] | unknown |
7F | uint8_t | DVB_S2 checksum of byte 00 to 7E |
Commands
The commands are saved chronologically in the way they shall be executed by the printer. Ahead of each command data a byte is written containing the byte-length of the command data and the checksum. Behind the data another byte is written cointaining the DVB_S2 checksum of the bytelength and the data. Example for moving the head up:
Bytelength | Command Data | DVB_S2 checksum |
---|---|---|
08 |
01 FF 04 00 00 01 00 |
D4 |