SGL (.sgl) Binary Data File Format
This data format was developed to overcome deficiencies in several other binary data formats. The important things to notice in the example given are the variable number of channels and the variable bytes per scan. These two variables allow this data format to store a wide range of data types. A selection of 1 byte per scan would be 8-bit data and the data size for each scan in the table would be 1 instead of 4. A selection of 2 bytes per scan would be 16-bit data and the data size for each scan would be 2 instead of 4. The default selection of 4 bytes per scan is for 32-bit data.
Example SGL 4-byte (32-bit) 4-channel 4-scan Binary Data File
| Section | Start Byte | End Byte | Data Value | Data Type | Byte Ordering | Data Size (Bytes)
| | Header | 0 | 3 | Number of channels | Integer | low-byte-first | 4
|
| Header | 4 | 7 | Bytes per scan (1-16 default 4) | Integer | low-byte-first | 4
|
| Header | 8 | 11 | Scan rate | Float | low-byte-first | 4
|
| Header | 12 | 75 | Acquisition Information | String | ASCII | 64
|
| Header | 76 | 83 | Channel 0 Calibration factor | Double | low-byte-first | 8
|
| Header | 84 | 91 | Channel 1 Calibration factor | Double | low-byte-first | 8
|
| Header | 92 | 99 | Channel 2 Calibration factor | Double | low-byte-first | 8
|
| Header | 100 | 107 | Channel 3 Calibration factor | Double | low-byte-first | 8
|
| Header | 108 | 171 | Channel 0 Information | String | ASCII | 64
|
| Header | 172 | 235 | Channel 1 Information | String | ASCII | 64
|
| Header | 236 | 299 | Channel 2 Information | String | ASCII | 64
|
| Header | 300 | 363 | Channel 3 Information | String | ASCII | 64
|
| Header | 364 | 427 | Channel 0 Name | String | ASCII | 64
|
| Header | 428 | 491 | Channel 1 Name | String | ASCII | 64
|
| Header | 492 | 555 | Channel 2 Name | String | ASCII | 64
|
| Header | 556 | 619 | Channel 3 Name | String | ASCII | 64
|
| Data | 620 | 623 | Channel 0 Scan 0 | Float (default) | low-byte-first | 4
|
| Data | 624 | 627 | Channel 1 Scan 0 | Float (default) | low-byte-first | 4
|
| Data | 628 | 631 | Channel 2 Scan 0 | Float (default) | low-byte-first | 4
|
| Data | 632 | 635 | Channel 3 Scan 0 | Float (default) | low-byte-first | 4
|
| Data | 636 | 639 | Channel 0 Scan 1 | Float (default) | low-byte-first | 4
|
| Data | 640 | 643 | Channel 1 Scan 1 | Float (default) | low-byte-first | 4
|
| Data | 644 | 647 | Channel 2 Scan 1 | Float (default) | low-byte-first | 4
|
| Data | 648 | 651 | Channel 3 Scan 1 | Float (default) | low-byte-first | 4
|
| Data | 652 | 655 | Channel 0 Scan 2 | Float (default) | low-byte-first | 4
|
| Data | 656 | 659 | Channel 1 Scan 2 | Float (default) | low-byte-first | 4
|
| Data | 660 | 663 | Channel 2 Scan 2 | Float (default) | low-byte-first | 4
|
| Data | 664 | 667 | Channel 3 Scan 2 | Float (default) | low-byte-first | 4
|
| Data | 668 | 671 | Channel 0 Scan 3 | Float (default) | low-byte-first | 4
|
| Data | 672 | 675 | Channel 1 Scan 3 | Float (default) | low-byte-first | 4
|
| Data | 676 | 679 | Channel 2 Scan 3 | Float (default) | low-byte-first | 4
|
| Data | 680 | 683 | Channel 3 Scan 3 | Float (default) | low-byte-first | 4
|
Example SGL 2-byte (16-bit) 4-channel 4-scan Binary Data File
| Section | Start Byte | End Byte | Data Value | Data Type | Byte Ordering | Data Size (Bytes)
| | Header | 0 | 3 | Number of channels | Integer | low-byte-first | 4
|
| Header | 4 | 7 | Bytes per scan (1-16 case 2) | Integer | low-byte-first | 4
|
| Header | 8 | 11 | Scan rate | Float | low-byte-first | 4
|
| Header | 12 | 75 | Acquisition Information | String | ASCII | 64
|
| Header | 76 | 83 | Channel 0 Calibration factor | Double | low-byte-first | 8
|
| Header | 84 | 91 | Channel 1 Calibration factor | Double | low-byte-first | 8
|
| Header | 92 | 99 | Channel 2 Calibration factor | Double | low-byte-first | 8
|
| Header | 100 | 107 | Channel 3 Calibration factor | Double | low-byte-first | 8
|
| Header | 108 | 171 | Channel 0 Information | String | ASCII | 64
|
| Header | 172 | 235 | Channel 1 Information | String | ASCII | 64
|
| Header | 236 | 299 | Channel 2 Information | String | ASCII | 64
|
| Header | 300 | 363 | Channel 3 Information | String | ASCII | 64
|
| Header | 364 | 427 | Channel 0 Name | String | ASCII | 64
|
| Header | 428 | 491 | Channel 1 Name | String | ASCII | 64
|
| Header | 492 | 555 | Channel 2 Name | String | ASCII | 64
|
| Header | 556 | 619 | Channel 3 Name | String | ASCII | 64
|
| Data | 620 | 621 | Channel 0 Scan 0 | Short | low-byte-first | 2
|
| Data | 622 | 623 | Channel 1 Scan 0 | Short | low-byte-first | 2
|
| Data | 624 | 625 | Channel 2 Scan 0 | Short | low-byte-first | 2
|
| Data | 626 | 627 | Channel 3 Scan 0 | Short | low-byte-first | 2
|
| Data | 628 | 629 | Channel 0 Scan 1 | Short | low-byte-first | 2
|
| Data | 630 | 631 | Channel 1 Scan 1 | Short | low-byte-first | 2
|
| Data | 632 | 633 | Channel 2 Scan 1 | Short | low-byte-first | 2
|
| Data | 634 | 635 | Channel 3 Scan 1 | Short | low-byte-first | 2
|
| Data | 636 | 637 | Channel 0 Scan 2 | Short | low-byte-first | 2
|
| Data | 638 | 639 | Channel 1 Scan 2 | Short | low-byte-first | 2
|
| Data | 640 | 641 | Channel 2 Scan 2 | Short | low-byte-first | 2
|
| Data | 642 | 643 | Channel 3 Scan 2 | Short | low-byte-first | 2
|
| Data | 644 | 645 | Channel 0 Scan 3 | Short | low-byte-first | 2
|
| Data | 646 | 647 | Channel 1 Scan 3 | Short | low-byte-first | 2
|
| Data | 648 | 649 | Channel 2 Scan 3 | Short | low-byte-first | 2
|
| Data | 650 | 651 | Channel 3 Scan 3 | Short | low-byte-first | 2
|
SGL Header Variable Descriptions
| Section | Data Value | Data Type | Byte Ordering | Data Size (Bytes) | Description
| | Header | Number of channels | Integer | low-byte-first | 4 | Stores the number of channels
|
| Header | Bytes per scan (1-16 default 4) | Integer | low-byte-first | 4 | Bytes per scan changes the number of bytes and the data type of the stored data scans
|
| Header | Scan rate | Float | low-byte-first | 4 | The rate that every channel is sampled or scanned
|
| Header | Acquisition Information | String | ASCII | 64 | Acquisition information like start time stamp in YYYYMMDDHHmmss format and other notes
|
| Header | Channel N Calibration factor | Double | low-byte-first | 8 | The calibration factor used to go from counts to volts or volts to Eus
|
| Header | Channel N Information | String | ASCII | 64 | Extra channel information like gauge number, frame number, bulkhead number, or location
|
| Header | Channel N Name | String | ASCII | 64 | The name of the channel; unused trailing characters should be the null character '\0'
|