LORD-MicroStrain / MSCL

MicroStrain Communication Library
https://www.microstrain.com/software/mscl
MIT License
76 stars 57 forks source link

Trouble by Parse the Logged Data from the SG-Link-200-OEM #357

Open 719283728 opened 12 months ago

719283728 commented 12 months ago

I am developing a program for the SG-Link-200-OEM for our application. In this work, we need to Get Logged Data from the SG-Link-200-OEM and then parse for our software. But I can not understand how to parse the “Data read from flash”. As instruction online, The “Data read from flash” should be “uint8_t data[102]”. But it seem I can only get 100 bit of data.

1, Node Information: SG-Link-200-OEM, with 2 Seconds/per Sample by Synchronized for 5 sample, (Slop: 4.6566e-6 Kgf/bit; Offset:-39.0625Kgf):

2, The data I got from directly from the Node: 07 1A 9A D3 12 00 01 72 02 00 00 65 08 32 60 00 00 00 00 3B 2D C0 00 CB DA 04 3C 07 1A 9A D3 12 00 01 72 02 00 01 65 08 32 62 00 00 00 00 BB BB 20 00 D7 D7 04 AD 07 1A 9A D3 12 00 01 72 02 00 02 65 08 32 64 00 00 00 00 3B 13 80 00 D3 D9 03 E8 07 1A 9A D3 12 00 01 72 02 00 03 65 08 32 66 00 00 00 00 BA 94 80 00 D6 D7 04 EB 07 1A 9A D3 12 00 01 72 02 00 04 65 08 32 68 00 00 00 00 3C 03 70 00 D4 D6 03 CF

I am very good understanding for those data that transmitted by the Node.

3, Get Logged Data from Node: AA 07 22 9A D3 6A 00 41 00 00 00 00 # BB 01 21 01 00 01 00 01 00 00 C0 7F E5 42 FA 85 17 72 01 00 0D 00 01 00 00 80 04 60 00 40 9C 36 00 40 1C C2 39 02 80 CC 2C #BA 01 36 FB 7F BD 6B BA 01 E3 01 80 D1 1F BA 01 0D FF 7F 4A 46 BA 01 BB 06 80 63 FC BA 01 E6 08 80 E8 29 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 D7 34 5A

I can not understand how to Parse the those data, Especially, there should be [102] bit for the Data read from flash according to the instruction online, but what I got is just [100] bit.

uint8_t startByte = 0xAA; //Start of Packet Byte uint8_t stopFlag = 0x07; //Delivery Stop Flag uint8_t appDataType = 0x22; //App Data Type uint16_t nodeAddress; //Node Address uint8_t payloadLen = 0x6C; //Payload Length uint16_t commandId = 0x0041; //Command ID Echo uint32_t address; //Flash Address of first byte downloaded uint8_t data[102]; //Data read from flash int8_t nodeRssi; //Node RSSI int8_t baseRssi; //Base Station RSSI uint16_t checksum; //Checksum of [stopFlag - data]

1) Could you please parse those data as an example for me? 2) Also, I need you to help to Parse the Block Header by those above data as well.