# SA2 save protocol — wavelength v1.7 :id=top

------

> _Doc Ver:_ 1.7  
_App Ver:_ 2.6.6.53  
_Date:_ 09/14/2026

------

> Integrator layout for **on-disk** wavelength frames when SA1 **Save protocol** (Data save **1.11** / `DS_SAVE_PROTO`) is `1`.  
> SA1 default remains original [`0x00`](data-wl.md). Live UDP **8190** and `:DATA:RAW?` stay original. `sa-file` reads both dialects. Register frames stay SA1 `0x20`/`0x21`.

Wavelength frame version: **0x10**. Floats are **little-endian absolute pm** (not nm, not −1 500 000). N is usually **32**; counts at offset **38**, `0xFDFDFDFD` at 70, floats from **74**, end `0xFCFCFCFC`. After [precise wavelength](precise_wl.md) the floats are calibrated.

|#|Byte|Field|Bytes|Value|Notes|
|:-:|:-:|----------|:-:|:------:|--------------------|
1|0|Start mark|4|0xFFFFFFFF|
2|4|Data version|1|0x10|Wavelength / cavity
3||||0x11|Spectrum (4096 voltage)
4||||0x02|Wavelength + spectrum
5||||0x03|Physical value
6||||0x04|Wavelength + physical (legacy)
7||||0x15|Wavelength + physical + virtual (new; old 0x05)
8||||0x20|Standard sensor register
9||||0x21|Standard + virtual register
10||||0x22|Precision-cal register
11||||0x23|Alarm register
12|5|Checksum|1|0x00|Reserved
13|6|Device SN|4||Zero if none
14|10|Device time|4|seconds|Unix seconds; zero if none
15|14||4|microseconds|
16|18|Counter|4||Wraps at max
17|22|Device status|4|0x00000000|No sensor data, no fault; if no data, omit fields after item 7 except the end mark
18||||0x00000001|Sensor data present, device normal
19||||0x00000002|Built-in laser thermometer fault
20||||0x00000004|Laser temperature abnormal
21||||0x00000008|Laser fault
22||||0x00000010|Device thermometer fault
23||||0x00000020|Device temperature abnormal
24||||0x00000040|Device hygrometer fault
25||||0x00000080|Device humidity abnormal
26||||0x00000100|Device vibration sensor fault
27||||0x00000200|Device excessive vibration fault
28||||0x00000400|Device temperature-control abnormal
29||||0x00000800|Device supply voltage abnormal
30||||0x00001000|Detector fault; channels in status 2
31||||0x00002000|Fiber path fault; channels in status 2
32||||0x00004000|Channel threshold abnormal; channels in status 2
33||||0x00010000|Insufficient CPU
34||||0x00020000|Data output busy
35||||0x00040000|Insufficient compute space
36||||0x00080000|Insufficient storage
37||||0x00100000|Data serial-port fault
38||||0x00200000|Network-port fault
39||||0x00400000|Indicator fault; type in status 2
40||||0x00800000|Key fault; type in status 2
41||||0x01000000|Display fault
42||||0x10000000|FBG missing alarm; count in status 2
43||||0x20000000|FBG warning; count in status 2
44||||0x40000000|FBG critical alarm; count in status 2
45||||0x80000000|Unknown fault
46|26|Device status 2|4||Extra status (detector, alarm counts)
47|30|Laser temperature|4||float32 LE
48|34|Header end|4|0xFEFEFEFE|
49|38|Sensors per channel|1×N||One byte per channel, low channel first; N = max channel count (32). Empty channels are 0.
50|38+N|Data start|4|0xFDFDFDFD|
51|42+N|Wavelengths|4×M||float32 LE absolute pm, channel order. M = sum of the N count bytes.
52|42+N+4×M|End|4|0xFCFCFCFC|

Frame length (bytes): **46+N+4×M**. With N=32: **78+4×M**.

CSV from `sa-file` matches original SA1 wavelength CSV (no header; absolute pm). Disk already stores absolute pm — **do not add 1 500 000**. Cookbook: [Save protocol and integration](data-save-proto.md). See [data save](data_save.md).

[Top](#top)

## Change log

|Version|Date|Description|
|:--:|----|----------|
|1.7|09/14/2026|1. Migrated SA2 v1.7 wavelength layout into SA1 help. Optional save via `DS_SAVE_PROTO=1`.|

------

[Top](#top)
