Difference between revisions of "Firmware-830 Message-004"
(→SAMPLE DATA (4, 04h)) |
|||
Line 1: | Line 1: | ||
==SAMPLE DATA (4, 04h)== | ==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. In host mode, if an analog sensor processing function is enabled and its output value is 1024, it will be output as such. | + | 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. In host mode, if an analog sensor processing function is enabled and its output value is 1024 (eg. in the case of lookup tables), it will be output as such. |
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: | 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: |
Revision as of 02:47, 1 May 2023
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. In host mode, if an analog sensor processing function is enabled and its output value is 1024 (eg. in the case of lookup tables), it will be output as such.
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 |
00000zzz: | zzz = [0..7]; the 3 least significant bits |
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.