Thoughtstream USB Raw Data Format
Hello,
I've searched through the past threads regarding the raw data format from the throughstream RS-232 and the USB versions. I was wondering if the USB data format is still the same as the older RS-232 setup?
ie:
9 Bytes total
Byte
1 Header
2 Header
3 Device Code Value
4 Relaxation value (255, all red; 0, all green)
5 & 6 Current 12/14 bit (rs232/usb respectively) ADC value recorded
7 Status of Thoughtstream
8 & 9 12/14 bit ADC value of the starting probe resistance set at the beginning of the session.
I don't seem to be getting a consistent 9 bytes, but rather something like 15 or 16 bytes.
This is based on the assumption that Bytes 1 and 2 are still the "header" values which have a value of "0". But to confuse the interpretation, there are a lot of file separator bytes (Decimal value "28"). Any clarification would be greatly appreciated.
Thanks,
Vinc.
Re: Thoughtsteram USB Raw Data Format
Hello Vinc;
The RS-232 version of the ThoughtStream had a different format than the USB version. The data in the USB version has a higher resolution and a different sampling rate.
Here is an example of a few seconds of raw data from the TS USB (in Hex):
A3-5B-08-22-CA-04-01-F6
A3-5B-08-22-CA-04-01-F6
A3-5B-08-22-CB-04-01-F7
A3-5B-08-22-CB-04-01-F7
A3-5B-08-22-CC-04-01-F8
A3-5B-08-22-CD-04-01-F9
A3-5B-08-22-D0-04-01-FC
A3-5B-08-22-D5-04-02-01
A3-5B-08-22-D8-04-02-04
A3-5B-08-22-DC-04-02-08
A3-5B-08-22-E0-04-02-0C
A3-5B-08-22-E5-04-02-11
A3-5B-08-22-E9-04-02-15
A3-5B-08-22-EF-04-02-1B
A3-5B-08-22-F2-04-02-1E
A3-5B-08-22-F4-04-02-20
A3-5B-08-22-F5-04-02-21
A3-5B-08-22-F8-04-02-24
A3-5B-08-22-F8-04-02-24
A3-5B-08-22-F7-04-02-23
A3-5B-08-22-F7-04-02-23
A3-5B-08-22-F7-04-02-23
A3-5B-08-22-F7-04-02-23
A3-5B-08-22-F7-04-02-23
I am getting 8 bytes, not 9. I don't have any current documentation, but others here have figured out the format and will hopefully reply.
1 Attachment(s)
Re: Thoughtsteram USB Raw Data Format
There are some differences in the formats.
The main thing is the baud rate.
TS USB uses 19200 and TS RS232 uses 4800.
There is also a difference in the precision of the reading as noted 12 vs 14bit.
The USB also updates more often.
One more thing is that there is additional status values (which you have noted above) in the RS232 that are not in the USB. The docs above refer to RS232.
I am attaching a PDF file that defines the TS USB format.
I suspect that your garbage info may be due to incorrect port settings... probably baud?
The hardest part of the TS format is that there is no delimiter. You must track the 'header' byte identifiers and then chunk out the 8 bytes in reference to that.
Hope this helps, ask if more info is needed.
Scott
Re: Thoughtsteram USB Raw Data Format
Right also RS232 has 9 bytes and USB has 8 bytes.
Re: Thoughtsteram USB Raw Data Format
Quote:
Originally Posted by
neuroasis
The hardest part of the TS format is that there is no delimiter. You must track the 'header' byte identifiers and then chunk out the 8 bytes in reference to that.
Depends on the Serial Port Library that you use.
In my case, using the .NET Serial Port functions, the DataReceived event only happens when a complete block of 8 bytes has been sent.
Re: Thoughtsteram USB Raw Data Format
However, you have to determine whether to truncate bytes if you start somewhere in the middle of a packet. The ThoughtStream just starts machine gunning data at you.
Re: Thoughtsteram USB Raw Data Format
Quote:
Originally Posted by
neuroasis
However, you have to determine whether to truncate bytes if you start somewhere in the middle of a packet. The ThoughtStream just starts machine gunning data at you.
Not with the .NET library, but with other libraries YMMV.
Re: Thoughtsteram USB Raw Data Format
So you have a working app then I guess?
Re: Thoughtsteram USB Raw Data Format
Quote:
Originally Posted by
neuroasis
So you have a working app then I guess?
Lol. Not as such, no. Just a simple data reader.
Re: Thoughtsteram USB Raw Data Format
Did you ever try that python-based software?