Jump to content
The simFlight Network Forums

_Jens_

Members
  • Posts

    7
  • Joined

  • Last visited

About _Jens_

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

_Jens_'s Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I have A question about FSUIPC. If I want to write or read some variables to or from the FS2002 I can use FSUIPC. For communicating with the FS2002 I have to use the Functions FSUIPC_Open, FSUIPC_Close, FSUIPC_Read, FSUIPC_Write and FSUIPC_Process. All these Functions uses sendMessage. My question now is, if there is a possibility to communicate with the Functions of FSUIPC.dll directly. I give an example. If I want to get the verticalSpeed, I have call FSUIPC_READ with the OFFSET of verticalSpeed. Perhaps, there is a special Function in the FSUIPC.DLL like read_verticlaSpeed. If so, how can I get access to this function, so that I don't have to call FSUIPC_READ. Thanks, Jens
  2. Hello Pete, I have some questions about how FSUIPC communicates with MSFS2002/04. I read the following in the document "FSUIPC for Programmers": Well, I don't realy understand what it means. Does it mean that when I'm using FSUIPC I don't communicate with the Flight Simulator directly? If so, is there any way to communicate with the Flight Simulatot directly, perhaps by using the Panels and Gauges SDK offered by Microsoft? I hope you can help me, thanks.
  3. I found out that it is possible to stop the threads of the FS. What I want to do is to develop a scheduler that schedules three processes and the FS is one them. Each process shall run 200 MS in each scheduling cycle. To achieve this for the FS, my intention was to resume the FS threads, let it run 200 ms and then stop the threads again. The problem is that FS catches up the time it was stopped as soon as it running again - of course it does so, because it is real-time processing. What I need is a possibility to reset or manipulate the internal FS timer to prevent it fom cataching up time. Otherwise I can't temporally synchchronise the three processes. Or do you know of any other method to control the simulation time of FS from outside? Maybe my idea of stopping and starting threads is not the best way. As I told, I also tried setting the FS to pause = FALSE, let it run 200 MS, and set pause to TRUE again. But setting to pause sometimes already takes even more than 100 MS. Curiously waiting for your answer, thank you and regards, Jens
  4. Hi, I now use FSUIPC version 3.45 but I have still the same problems. I have written a scheduler which schedules some programs. I want each of this programs to get 200 ms of processor time and then went to sleep. In the case of the FS2002 I first tried to use the pause function by writting 0 or 1 to offset 0262 as I already described. Unfortunately setting the FS to pause mode takes too long (50 .. 100 msec). Because of this result I tried to write a faster pause function (see my first posting). To find the point where I loose this time I measured the time at different points within my function. So I find out that the execution of SendMessageTimeout(m_hWnd, m_msg, m_atom, 0, SMTO_BLOCK, 2000, &dwError); takes between 10 and 100 msec. My first question is, if there is a Windows function faster then SendMessageTimeout that I can use? My second question concerns using threads. I want to now, how the FS notice that I suspend its threads. Is there an internal clock or something. If so, how can I take control of it? I hope you can help me with that. Thanks
  5. Hi, I have a few questions and hope you can help me with that. I am writing a C-program and use the MS Flight Simultor 2002 and FSUIPC version 2.87. The program starts the Flight Simulator, gives it 200 ms and stops it. For that I use the offset 0262. For pause I write 1 and for un-pause I write 0 to it. This works but it takes too long to set or unset the pause (50 ms on average). So I try to find a faster way to set or unset the pause. First I tried to write a faster setPause function in the IPCUser.c file (see below). void FSUIPC_setPause(gboolean bval) { DWORD *pdw; DWORD dwError; FS6IPC_WRITESTATEDATA_HDR *pHdr = (FS6IPC_WRITESTATEDATA_HDR *) m_pNext; // Initialise header for write request pHdr->dwId = FS6IPC_WRITESTATEDATA_ID; pHdr->dwOffset = 0x0262; pHdr->nBytes = 1; // Copy in the data to be written CopyMemory(&m_pNext[sizeof(FS6IPC_WRITESTATEDATA_HDR)], &bval, 1); // Update the pointer ready for more data m_pNext += sizeof(FS6IPC_WRITESTATEDATA_HDR) + 1; ZeroMemory(m_pNext, 4); // Terminator m_pNext = m_pView; SendMessageTimeout(m_hWnd, m_msg, m_atom, 0, SMTO_BLOCK, 2000, &dwError); if (dwError != FS6IPC_MESSAGE_SUCCESS) { MDL_WARNING("ERROR setting MS/FS to pause."); return; } // Decode and store results of Read requests pdw = (DWORD *) m_pView; *pdw = 0; m_pNext = m_pView; return; } That works, but I still have the problem that it takes too long. With the command SendMessageTimeout(m_hWnd, m_msg, m_atom, 0, SMTO_BLOCK, 2000, &dwError); you can set the time, the system is waiting for set or unset the pause (2000 ms by default). I set this value to 0 but it doesn't have any effect. Perhaps someone of you know why or where I make a mistake. My second idea was to suspend all FS threads after 200 ms and then, if the FS should get the next 200 ms, resume all FS threads. Unfortunately it doesn't realy work. Somehow the FS notices that its threads where suspended and tries to retrieve this time. Does anyone know how the FS notices the suspending of its threads? I hope you have any ideas and can help me with my problems. Thanks! [/code]
  6. First of all thank you for answering my questions so quickly. When I was playing with the Flight Simulator I noticed a kind of time lag. I pressed the P key on my keyboard to set the Flight Simulator on Pause, but the vertical speed display (and only this display) didn't stop immediately. Is that normal? I had the idea to measure this time lag if it existed. To do this I want to read the local time directly after I press the P key and some seconds after that. If there is a difference between this two Measurements I know that there is a time lag. The problem is that I can't read the milliseconds of the local time and so it's not possible to proof the time lag. Perhaps you have any ideas how I can measure the time lag in a better way? Thanks a lot, Jens
  7. Hello! I'm working with MS Flight Simulator 2002 and FSUIPC 3.3.0.0 under Windows XP. I want to get the local time of the Flight Simulator in msec. Unfortunately FSUIPC just offers the possibility of getting the local time in hours, minutes and seconds. How can I get this time more excectly? Any ideas? Thanks a lot!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.