Hi,
I try to understand how to use the IDL serial interface with an IMU device connected with bluetooth interface.
I have 2 questions, one directly related to the serial procedure and the other more about data format.
According to the documentation of the device, the data are output as follow:
The data stream begins with the 'A' ASCII character followed by up to 13 measurements and ends with the 'Z' ASCII character. Each measurements is two bytes in the data stream. Each two-byte segment utilizes the lowest ten bits for the measurements (the upper six bits will be read as 0). Data are sent MSB first.
So my stream would be something like:
...,[65B],[1Byte 26 times],[90B], [65B],[1Byte 26 times],[90B],...
First Question:
I've read the thread #2500:How to use serial.dlm(dll) for control the device via RS 232? to understand how to read data from the serial port. However, when I use this code to read the stream, each packet of data start randomly somewhere in the data structure...
So, simple question, is there a way to make sure to ready the stream at each start (the 'A' code) of the data stream, or did I have to retrieve it manually ?
Also, could it be possible to get a timestamp (base on the number on miliseconds since the first January 1970, if I remember correctly the reference) of each byte read using systime() ?
Second Question:
I did manage to get some data streaming from the device even if it's not synchronized... however I'm a bite perplex on how to convert a two-byte segment in a 10bits measurment ? Any hit would be greatly appreciate.
Thank again for you time, all.
Best Regards.
Antoine C.
|