for my Thesis I need to connect a Head-Tracking sensor to an exisiting car simulator software. The car simulator is able to receive TCL commands via DDE and so far I have successfuly established a communication channel. The idea is to use the data from the sensor to adjust the current view on the simulator window.
The sensor data is processed with the help of a c++ application that also acts as DDE client and sends the command string to the DDE server (the simulator). Using an example from Microsoft (see here: http://support.microsoft.com/kb/279721/en-us) I'm sending the command string with the following line:
DdeClientTransaction((LPBYTE)hData, 0xFFFFFFFF, hConv, 0L, 0, XTYP_EXECUTE,
TIMEOUT_ASYNC, NULL);
The variable hData represent after some other function calls the string to transfer to the TCL interpreter on the simulator. The command string I'm sending recursively is exclusive to the simulator and looks as follows:
"Movie eval {dict set View(0:0) xrot %s; dict set View(0:0) yrot %s; dict set View(0:0) zrot %s;}"
In case you wonder %s are the placeholders for the yaw,pitch and roll of the headtracker.
Everything is working correctly. However I got the feeling that the TCL interpeter of the simulator is sometimes to slow and ends up hanging the whole simulator.
On the DDE side, the DdeClientTransaction-function returns a value whether the transaccion was successful/busy and I'm using this to avoid spamming the DDE server (simulator), so I suspect the issue is the TCL interpreter being to slow.
My question is now: Is there a TCL command I can add into my command string or another way to have the interpreter process the next received command via DDE once it's done with the previous one, and incase there are more commands queued up, just process the newest one?
I've noted that sending update;:
"Movie eval {dict set View(0:0) xrot %s; dict set View(0:0) yrot %s; dict set View(0:0) zrot %s; update;}"
is more stable, but I don't quite understand what it does.