Special:
|
[DAT] (requires LDraw-compatible viewer)
|
Subject:
|
Re: Spirit.ocx in VC++
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sun, 5 Mar 2000 20:13:16 GMT
|
Viewed:
|
892 times
|
| |
| |
Hi Steve, Len and All,
I was closer to the solution than I thought!
The code I posted this morning was correct.
What I missed was the format of the datalog, which is very
hard to understand from the docs of spirit.ocx.
After hacking around for a while I found that the format of the
array of 2-bytes integers that represents the datalog is:
*- header -*
1 255
2 0
3 number of data logged
*- 1st logged value -*
4 type of data source (0=variable, 1=timer, 9=sensor)
5 number of data source (0-31 variables, 0-3 timers, 0-2 sensors)
6 logged value
*- 2nd logged value -*
8 type of data source
9 number of data source
10 logged value
*- 3rd logged value -*
11 ... and so on ...
For example:
255
0
3
1
0
10
9
1
765
0
3
85
is the raw array for the following datalog:
Timer_0: 10
Sensor_2: 765
Variable_3: 85
Pretty easy, isn't it?
Now a question arises: why use 2 2-byte integers to address the data
source, when a 6-bit integer would have been more than enough???
I hope this is only a format given by UploadDatalog method, and in
the RCX the datalog is stored in a more compact way, because it is
an *amazing* waste of memory!
Bye,
Antonio
|
|
Message has 1 Reply: | | Re: Spirit.ocx in VC++
|
| Well done! I expect the datalog data is just represented in this way for ease of use by VB programmers. ----- Original Message ----- From: iant <iant@libero.it> To: <lego-robotics@crynwr.com> Sent: Sunday, March 05, 2000 8:13 PM Subject: Re: (...) (25 years ago, 5-Mar-00, to lugnet.robotics)
|
Message is in Reply To:
| | Re: Spirit.ocx in VC++
|
| Hi Steve, (...) That's right. In the case of the datalog the type of the "vt" is (VT_ARRAY | VT_I2), that is an array of 2-byte integers. (...) Thank you very much, Steve. Your message was helpful for me to understand I'm in the right way to the (...) (25 years ago, 5-Mar-00, to lugnet.robotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|