Firmware-830 Message-004

From I-CubeX Wiki
Revision as of 18:45, 17 December 2023 by Admin (talk | contribs) (SAMPLE DATA (4, 04h))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

SAMPLE DATA (4, 04h)

The SAMPLE DATA message contains a single snapshot of a sensor connected to a sensor input, whether the WiDig is in host or in stand-alone mode. In stand-alone mode, data from adjacent higher-numbered inputs in ghost mode will also be output. If an analog sensor processing function is enabled and its output value is greater than 1023 (eg. in the case of lookup tables), it will be output as value 1024 in host mode. It will be skipped in stand alone mode.

In host mode, the [BODY] of the SAMPLE DATA message is composed of two or three bytes - the sensor input number, the first data byte, and, if the sensor input is set to 10-bit hi-res mode, the second data byte:

7-bit lo-res mode

00000xxx: xxx = [0..7]; sensor input number, where the first sensor input number = 0, and the last (8th) sensor input number = 7
0yyyyyyy: yyyyyyy = [0..127]; the most significant bits

10-bit hi-res mode

00000xxx: xxx = [0..7]; sensor input number, where the first sensor input number = 0, and the last (8th) sensor input number = 7
0yyyyyyy: yyyyyyy = [0..127]; the most significant bits
000zzz00: zzz = [0..7]; the 3 least significant bits

Skip value

00000xxx: xxx = [0..7]; sensor input number, where the first sensor input number = 0, and the last (8th) sensor input number = 7
0yyyyyyy: yyyyyyy = 127; the most significant bits
00xzzz00: zzz = 32; the 3 least significant bits
x = 1; don't output value in stand-alone mode


Example:

When sampling sensor input 8 (provided it is turned off) and the sensor input is set to lo-res mode, the following message is received:

240, 125, 0 {DEV}, 4 {SAMPLE DATA}, 7 {xxx}, 64 {yyyyyyy}, 247 (F0h, 7Dh, 00h, 04h, 07h, 40h, F7h)

The sampled value from sensor input 8 is 64.

When sampling sensor input 8 (provided it is turned off) and the sensor input is set to hi-res mode, the following message is received:

240, 125, 0 {DEV}, 4 {SAMPLE DATA}, 7 {xxx}, 10 {yyyyyyy}, 10 {zzz}, 247 (F0h, 7Dh, 00h, 04h, 07h, 0Ah, 0Ah, F7h)

The sampled value from sensor input 8 is 10 * 8 (i.e. 3 bit shift) + 10 = 90.