If anyone can spare 2 minutes to explain the reason for using Tagged Data in Sim Connect, I would be very grateful.
I'll try. Sorry I speak C, so I hope you can follow:
Take an example where one Data Definition contains three variables, added in this order:
X a floating point 64 bit value
Y a 32-bit integer
Z a 32 byte string
Without tagging the data exchanged, each time it needed to be (e.g. each time any of them changed), is done so in a block formed by this structure:
struct {
double X;
int Y;
char Z[32];
} MyData;
That's fine, and it is efficient enough for a small number of values, or if none of the values change very frequently, or all of them change frequently. This is because they ALL have to be present every time -- otherwise you or simconnect wouldn't be able to encode/decode the values.
One alternative is to use a different data definition for each separate value. In fact I had to do this to Write SimVars in Betas1 and 2 of FSX because Tagged Data could only be used for Reads.
With tagged data you don't have a fixed structure for all the variables in the data definition. You have the data supplied as needed, but each entry is preceded by its ID, as a 32-bit DWORD. Each variable is effecitvely structured separately, thus:
struct {
DWORD id;
double X;
} MyX;
struct {
DWORD id;
int Y;
} MyY;
struct {
DWORD id;
char Z[32];
} MyZ;
Then, the data transferred in any one read or write could be a mix of these, or just one, all strung together.
This way you only get or send the data items which have changed.
So, it's horses for courses. you need to decide which is the best for your data -- and, don't forget, splitting your data into different Data Definitions any way. Some may be best tagged, others best untagged. It is very flexible.
Hope this is understandable?
[BTW my carefully tabbed text doesn't come out tabbed when posted. Anyone know how to make that happen? Even spaces at the start of the line are discarded!! :-(]
Regards
Pete