Difference between revisions of "Lascar Electronics EL-USB protocol"
(4 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Communication == | == Communication == | ||
The Lascar data loggers all use a Silicon labs USB interface chip, which presents just two endpoints | The Lascar data loggers all use a Silicon labs USB interface chip, which presents just two endpoints: | ||
{| border="0" style="font-size: smaller;" class="alternategrey sigroktable" | |||
|- | |||
! Endpoint | |||
! Direction | |||
! Transfer type | |||
! Max packet size | |||
|- | |||
| 2 | |||
| IN | |||
| Bulk | |||
| 64 | |||
|- | |||
| 2 | |||
| OUT | |||
| Bulk | |||
| 64 | |||
|} | |||
== Protocol == | == Protocol == | ||
Line 217: | Line 238: | ||
|- | |- | ||
| 4 | | 4 | ||
| | | Logging start (1) or stop | ||
|- | |- | ||
| 5 | | 5 | ||
Line 242: | Line 263: | ||
| 0x24 | | 0x24 | ||
| 4 | | 4 | ||
| '' | | '''Calibration high''' (stored as little-endian BINARY32 single-precision float) | ||
|- | |- | ||
| 0x28 | | 0x28 | ||
| 4 | | 4 | ||
| '' | | '''Calibration low''' (stored as little-endian BINARY32 single-precision float) | ||
|- | |- | ||
Line 255: | Line 276: | ||
|- | |- | ||
| 0x2e | | valign="top" | 0x2e | ||
| 2 | | valign="top" | 2 | ||
| '''Device-specific configuration''' | | style="padding: 0;" | '''Device-specific configuration''' (16-bit little-endian integer or bitfield) | ||
{| border="0" width="100%" style="margin: 0;" class="alternategrey sigroktable" | |||
|- | |||
! align="left" colspan="2" | EL-USB-1*, EL-USB-2*, EL-USB-LITE, EL-USB-TC* | |||
|- | |||
| style="width: 5em;" | 0x0000 | |||
| Celcius | |||
|- | |||
| 0x0001 | |||
| Fahrenheit | |||
|} | |||
|- | |- |
Latest revision as of 11:11, 12 March 2013
Lascar Electronics makes a series of devices in the "EL-USB" range. They share the same basic protocol, differing only in small details and log data format related to the device type.
Communication
The Lascar data loggers all use a Silicon labs USB interface chip, which presents just two endpoints:
Endpoint | Direction | Transfer type | Max packet size |
---|---|---|---|
2 | IN | Bulk | 64 |
2 | OUT | Bulk | 64 |
Protocol
Commands
Bytes | Command |
---|---|
0x00 0xff 0xff | Load device configuration structure.
A 3-byte header is returned first in which the first byte is 0x02, and the second and third bytes are the length of the configuration structure to follow, as a little-endian integer representing the number of bytes. Different devices in the EL-USB series have differently-sized configuration structures. |
0x01 0xnn 0xnn | Save device configuration structure.
The second and third bytes are the length of the configuration structure to follow, as a little-endian integer representing the number of bytes. The device responds with a single byte with value 0xff when the configuration has been saved. |
0x03 0xff 0xff | Transfer logged data.
A 3-byte header is returned first in which the first byte is 0x02, and the second and third bytes are the length of the logged data to follow, as a little-endian integer representing the number of bytes. The device's entire sample memory is then transferred. The number of stored samples (offset 0x2e in the configuration structure) should be checked before interpreting the data; any remaining data in the transfer should be ignored. |
Device configuration structure
Offset | Size | Value | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x00 | 1 | Device type
| ||||||||||||||||||||||||||||||||||||
0x01 | 1 | Unused | ||||||||||||||||||||||||||||||||||||
0x02 | 16 | NULL-terminated device name (15 chars max) | ||||||||||||||||||||||||||||||||||||
0x12 | 1 | Start time, hour (0-23) | ||||||||||||||||||||||||||||||||||||
0x13 | 1 | Start time, minute (0-59) | ||||||||||||||||||||||||||||||||||||
0x14 | 1 | Start time, second (0-59) | ||||||||||||||||||||||||||||||||||||
0x15 | 1 | Start date, day (1-31) | ||||||||||||||||||||||||||||||||||||
0x16 | 1 | Start date, month (1-12) | ||||||||||||||||||||||||||||||||||||
0x17 | 1 | Start date, year (year - 2000) | ||||||||||||||||||||||||||||||||||||
0x18 | 4 | Seconds remaining until logging starts (unsigned little-endian) | ||||||||||||||||||||||||||||||||||||
0x1c | 2 | Samplerate, as seconds between samples (unsigned little-endian) | ||||||||||||||||||||||||||||||||||||
0x1e | 2 | Number of stored samples (unsigned little-endian) | ||||||||||||||||||||||||||||||||||||
0x20 | 1 | Alarm conditions bitfield (1=enable)
| ||||||||||||||||||||||||||||||||||||
0x21 | 1 |
| ||||||||||||||||||||||||||||||||||||
0x22 | 1 | Temperature alarm high (value + 40) * 2 | ||||||||||||||||||||||||||||||||||||
0x23 | 1 | Temperature alarm low (value + 40) * 2 | ||||||||||||||||||||||||||||||||||||
0x24 | 4 | Calibration high (stored as little-endian BINARY32 single-precision float) | ||||||||||||||||||||||||||||||||||||
0x28 | 4 | Calibration low (stored as little-endian BINARY32 single-precision float) | ||||||||||||||||||||||||||||||||||||
0x2c | 2 | unknown (00 00) | ||||||||||||||||||||||||||||||||||||
0x2e | 2 | Device-specific configuration (16-bit little-endian integer or bitfield)
| ||||||||||||||||||||||||||||||||||||
0x30 | 4 | Firmware version (ASCII, not NULL-terminated | ||||||||||||||||||||||||||||||||||||
0x34 | 2 | Serial number (unsigned little-endian) | ||||||||||||||||||||||||||||||||||||
0x36 | 2 | unknown (00 00) | ||||||||||||||||||||||||||||||||||||
0x38 | 1 | Relative humidity alarm high (value * 2) | ||||||||||||||||||||||||||||||||||||
0x39 | 1 | Relative humidity alarm low (value * 2) | ||||||||||||||||||||||||||||||||||||
0x3a | 2 | unknown (00 00) | ||||||||||||||||||||||||||||||||||||
0x3c | 4 | unknown (00 00 00 00) |