Historical Data Enquiry
This chapter describes data retrievability feature to send downlink command to enquire the historical data stored in the device. Before that, ensure the device time is correct and data storage feature is enabled to store data.
- Command Format:
-
Item Channel Type Byte Description Enquire Data in Time Point fd 6b 4 Unix timestamp, Unit: s Enquire Data in Time Range fd 6c 8 Byte 1-4: Start timestamp, Unit: s Byte 5-8: End timestamp, Unit: s
Stop Query Data Report fd 6d 1 ff Data Retrievability Interval f9 0e 2 UINT16, Unit: s, Range: 30~1200, Default: 60 - Reply Format:
-
Item Channel Type Byte Description Enquiry Result fc 6b/6c 1 00: Enquiry success. The device will report the historical data according to data retrievability interval. 01: Time point or time range invalid
02: No data in this time or time range
- Use Unix Timestamp Converter to calculate the time.
- The device only uploads no more than 300 data records per range enquiry.
-
When enquiring the data in time point, it will upload the data which is closest to the search point within the reporting interval range. For example, if the device’s reporting interval is 10 minutes and users send command to search for 17:00’s data, if the device find there is data stored in 17:00, it will upload this data; if not, it will search for data between 16:50 to 17:10 and upload the data which is closest to 17:00.
- Example:
- Enquire the historical data in a time range.
Reply:fd6c 64735b63 7c885b63 Channel Type Value fd 6c Start time: 64 73 5b 63 => 63 5b 73 64 = 1666937700s End time: 7c 88 5b 63 => 63 5b 88 7c = 1666943100s
fc6c00 Channel Type Value fc 6c 00: Enquiry success
|
21ce 0d755b63 01 8085 1400000000000000 ddff000000000000 |
|||
|---|---|---|---|
| Channel | Type |
Time Stamp |
Value |
| 21 | ce | 0d 75 5b 63 => 63 5b 75 0d=1666938125s |
01: Channel 2 Crtl: 8085 => 1 000010 110000000 Bit15: 1=>signed Bit14-9: 000010 => 02=Input16_AB Bit8: 1=> Fetch success Bit7-6:10 = Two registers Bit5-4:00 => Normal Data Value 1: 14 00 00 00 00 00 00 00=>00 00 00 00 00 00 00 14=>20 Value 2: dd ff 00 00 00 00 00 00=>00 00 00 00 00 00 ff dd => -35 |