Jump to content
The simFlight Network Forums

yindengxie

Members
  • Posts

    112
  • Joined

  • Last visited

Everything posted by yindengxie

  1. Hello Pete, Very many THANKS, Pete! I will improve my program according to your suggestion. Best Regards! Dengxie
  2. Hello Pete, Thanks for your reply. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if (FSUIPC_Write(0x055C, 2, &OnGround, &dwResult)) FSUIPC_Process(&dwResult); //uint32 OnGround = 0; //0 in-flight, 1 on-ground if (FSUIPC_Write(0x0238, 1, &DayTime, &dwResult)) FSUIPC_Process(&dwResult); //uint8 DayTime=11 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if the above-mentioned two lines are commented, the screen pops up the additional program box (my application program: FSUIPC_YIN.EXE), everything is OK! else if the following two lines are NOT commented, the screen will NOT pop up the additional program box (my application program: FSUIPC_YIN.EXE) and my application program: FSUIPC_YIN.EXE will run at the background, in this case, there is data communication problem. =============================================================== Note: We separately start (1) P3D and then start (2) FSUIPC_YIN.EXE, our simulator system has been working normally for a long time, no problem for data communication. our FSUIPC_YIN.EXE always runs on background. Two months ago, you told me that we may use your "Programs: Facilities to load and run additional programs", so that we start P3D, in the same time, our FSUIPC_YIN.EXE is started automatically. Therefore, I add the following two lines to FSUIPC6.INI [Programs] Run1=READY,KILL,C:\FSUIPC_YIN\\Release\FSUIPC_YIN.EXE Now it is a problem for Programs: Facilities to load and run additional programs". PS: I do not understand your " you are still doing too many FSUIPC Process requests. Just do one per loop." THANKS Pete Dengxie
  3. //--------------- FSUIPC_OPEN Begin ------------------------------------------- if (!FSUIPC_Open(SIM_ANY, &dwResult)) { printf ("UIPChello: Failed to open link to FSUIPC: %s \n", pszErrors[dwResult]); } else { if (FSUIPC_Write(0x8001, 12, chOurKey, &dwResult)) FSUIPC_Process(&dwResult); printf (" FSUIPC OK \n"); } if (FSUIPC_Write(0x05DC, 2, &Slew, &dwResult)) FSUIPC_Process(&dwResult); if (FSUIPC_Write(0x0BC8, 2, &Parking, &dwResult)) FSUIPC_Process(&dwResult); //Pete: if the following two lines are commented, the screen pops up the additional program box (FSUIPC_YIN.EXE) in the attached picture below, everything is OK! else if the following two lines are NOT commented, the screen will NOT pop up the additional program box (FSUIPC_YIN.EXE) , there is data communication problem. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if (FSUIPC_Write(0x055C, 2, &OnGround, &dwResult)) FSUIPC_Process(&dwResult); //uint32 OnGround = 0; //0 in-flight, 1 on-ground if (FSUIPC_Write(0x0238, 1, &DayTime, &dwResult)) FSUIPC_Process(&dwResult); //uint8 DayTime=11 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //--------------- FSUIPC_OPEN End --------------------------------------------- while (1) { Sleep (10); VisualToServer.MsgID = 5; int ret = sendto(sServer, VisualToServer.temp, sizeof(TVisualToServer), 0, (SOCKADDR *)&recipientServer, sizeof(recipientServer)); if (ret == SOCKET_ERROR) printf("sendto() failed; %d\n", WSAGetLastError()); //-------- Read UDP Data Begin ---------------------------------------------------------- FD_ZERO(&ReadSet); //Prepare the Read and Write socket sets for network I/O notification. FD_SET(sVIS, &ReadSet); //Always look for connection attempts. //Set Read notification for the socket based on the current state the buffer. //If there is data remaining in the buffer then set the Write set otherwise the Read set. if ((ret = select(0, &ReadSet, NULL, NULL, &waittime)) == SOCKET_ERROR) { printf("select() returned with error %d\n", WSAGetLastError()); } if (ret != 0) { int nRead = recv(sVIS,ServerToVisual.temp,sizeof(ServerToVisual.temp),0); if (nRead == SOCKET_ERROR) { printf("recv() failed; %d\n", WSAGetLastError()); } else { msgID = ServerToVisual.View.MsgID; LatYin = ServerToVisual.View.lat; //Degree LonYin = ServerToVisual.View.lon; //Degree AltYin = ServerToVisual.View.alt; //Meter PitchYin = (-ServerToVisual.View.pitch * 57.3); //Degree BankYin = (-ServerToVisual.View.bank * 57.3); //Degree HeadingYin = ServerToVisual.View.heading * 57.3; //Degree } } //----------------- Read UDP Data End -------------------------- //----------------- Latitude Begin ----------------------------- LatBig = (_int64) ((LatYin * 10001750.0 * 65536.0 * 65536.0)/90.0); if (FSUIPC_Write(0x0560, 8, &LatBig, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Latitude Write Error! \n"); } //----------- Longitude Begin ----------------------------------- LonBig = (_int64) ((LonYin * 65536.0 * 65536.0 * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x0568, 8, &LonBig, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Longitude Write Error! \n"); } //---------------- Altitude Begin ------------------------- AltBig = (_int64) (AltYin*65536*65536); if (FSUIPC_Write(0x0570, 8, &AltBig, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Altitude Write Error! \n"); } //--------------- Pitch Begin ---------------------------------- Pitch = long ((PitchYin * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x0578, 4, &Pitch, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Pitch Write Error! \n"); } //--------------- Bank Begin ----------------------------------- Bank = long ((BankYin * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x057C, 4, &Bank, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Bank Write Error! \n"); } //-------------- Heading Begin --------------------------------- Heading = long ((HeadingYin * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x0580, 4, &Heading, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Heading Write Error! \n"); } }//while FSUIPC_Close(); //Closing when it wasn't open is okay, so this is safe here return 0 ; //---------------- FSUIPC End ---------------------------------- } ======================================================================= Hello Pete, THANKS for your help! Dengxie
  4. Hello Pete, Very many THANKS, Pete! I will improve my program according to your suggestion. Best Regards! Dengxie
  5. while (1) { //--------------- Read UDP Data Begin ---------------------------------------- Sleep (10); //100 VisualToServer.MsgID = 5; VisualToServer.View.HAT = HAT = 1.0; VisualToServer.View.elevMeter = elevMeter; VisualToServer.View.pitchBack = pitchBack = PitchPosition; VisualToServer.View.rollBack = rollBack = RollPosition; VisualToServer.View.rudderBack = rudderBack = RudderPosition; int ret = sendto(sServer, VisualToServer.temp, sizeof(TVisualToServer), 0, (SOCKADDR *)&recipientServer, sizeof(recipientServer)); if (ret == SOCKET_ERROR) printf("sendto() failed; %d\n", WSAGetLastError()); //-------- Read UDP Data Begin ---------------------------------------------------------- FD_ZERO(&ReadSet); //Prepare the Read and Write socket sets for network I/O notification. FD_SET(sVIS, &ReadSet); //Always look for connection attempts. //Set Read notification for the socket based on the current state the buffer. //If there is data remaining in the buffer then set the Write set otherwise the Read set. if ((ret = select(0, &ReadSet, NULL, NULL, &waittime)) == SOCKET_ERROR) { printf("select() returned with error %d\n", WSAGetLastError()); } if (ret != 0) { int nRead = recv(sVIS,ServerToVisual.temp,sizeof(ServerToVisual.temp),0); if (nRead == SOCKET_ERROR) { printf("recv() failed; %d\n", WSAGetLastError()); } else { msgID = ServerToVisual.View.MsgID; LatYin = ServerToVisual.View.lat; //Degree LonYin = ServerToVisual.View.lon; //Degree AltYin = ServerToVisual.View.alt; //Meter PitchYin = (-ServerToVisual.View.pitch * 57.3); //Degree BankYin = (-ServerToVisual.View.bank * 57.3); //Degree HeadingYin = ServerToVisual.View.heading * 57.3; //Degree } } //----------------- Read UDP Data End -------------------------- //----------------- Latitude Begin ----------------------------- LatBig = (_int64) ((LatYin * 10001750.0 * 65536.0 * 65536.0)/90.0); if (FSUIPC_Write(0x0560, 8, &LatBig, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Latitude Write Error! \n"); } //----------- Longitude Begin ----------------------------------- LonBig = (_int64) ((LonYin * 65536.0 * 65536.0 * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x0568, 8, &LonBig, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Longitude Write Error! \n"); } //---------------- Altitude Begin ------------------------- AltBig = (_int64) (AltYin*65536*65536); if (FSUIPC_Write(0x0570, 8, &AltBig, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Altitude Write Error! \n"); } //--------------- Pitch Begin ---------------------------------- Pitch = long ((PitchYin * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x0578, 4, &Pitch, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Pitch Write Error! \n"); } //--------------- Bank Begin ----------------------------------- Bank = long ((BankYin * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x057C, 4, &Bank, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Bank Write Error! \n"); } //-------------- Heading Begin --------------------------------- Heading = long ((HeadingYin * 65536.0 * 65536.0)/360.0); if (FSUIPC_Write(0x0580, 4, &Heading, &dwResult)) { FSUIPC_Process(&dwResult); } else { printf("Heading Write Error! \n"); } //----------------- Aircraft End ------------------------------- }//while FSUIPC_Close(); //Closing when it wasn't open is okay, so this is safe here return 0 ; //---------------- FSUIPC End ---------------------------------- } ===================================================================== Hello Pete, THANKS for your quick reply to my question. 1) Our P3D is only used as Visual Display for our simulator. 2) We use your FSUIPC6 to communicate with P3D. 3) We use the above-mentioned program named FSUIPC_YIN.EXE program copied from your example program to communicate with your FSUIPC6. 4) The above-mentioned program named FSUIPC_YIN.EXE receives Lat, Lon, Alt, Pitch, Bank, Heading from our Main Simulator program and immediately to transfer these Lat, Lon, Alt, Pitch, Bank, Heading to your FSUIPC6 (then P3D). ================================================================ We separately start (1) P3D and then start (2) FSUIPC_YIN.EXE, our simulator system has been working normally, no problem for data communication. =============================================================== Two months ago, you told me that we may use your "Programs: Facilities to load and run additional programs", so that we start P3D, in the same time, our FSUIPC_YIN.EXE is started automatically. Therefore, I add the following two lines to FSUIPC6.INI [Programs] Run1=READY,KILL,C:\FSUIPC_YIN\\Release\FSUIPC_YIN.EXE ================================================================== Now P3D can load and run the FSUIPC_YIN.EXE. However, the simulator have been running on the Runway, NOT to take off. It seems the Altitude is not sent to P3D. If after starting P3D (FSUIPC_YIN.EXE automatically started), ONLY we move (refresh) P3D display one time (Big display to small display, then come back to Big display) , everything is OK! Question: After P3D automatically load and run our FSUIPC_YIN.EXE, Why do we need to move (refresh) P3D display screen one time by HAND operation? THANKS for your help!
  6. Hi, I add the following two lines to FSUIPC6.INI [Programs] Run1=READY,KILL,C:\FSUIPC_YIN\\Release\FSUIPC_YIN.EXE -------------------------------------------------------------- P3D can load and run the additional program. However, the first time, P3D display screen must be refreshed by HAND operation, the additional program can communicate with P3D and our simulator main program in the later. Question: Can P3D automatically load and run the additional program, NOT need to refresh P3D display screen by HAND operation in the first time? THANKS for your help!
  7. Very many THANKS, John! Our program starts from FSUIPC. So I will see the Advanced User Guide, section Programs: facilities to load and run additional programs. BEST REGARDS! Dengxie Yin
  8. Hello Pete and John, Good Evening! I want to ask you a simple question not related to FSUIPC. If it is convenient for you, please give me a help. When P3D is started, your Add-on FSUIPC6 is also started and running in the same time. We have a program copied from your example program, this program communicates with your FSUIPC6. Question: How can our this communication program be set , so that when P3D is started, also our this communication program in the same time is started and running? THANKS! Dengxie Yin
  9. THANKS, THANKS, THANKS, Pete and John for your INFO!
  10. Hi John, You always give me great help, THANKS! Indeed, MSFS is different with FSX and P3D. I have some test with MSFS and tell you as follows: 1) Start MSFS with FSUIPC7. 2) Start our small program (coped from your example program) to run on the Visual computer: The small program receives Lat, Lon, Altitude, Pitch, Bank and Heading from LAN (UDP) and immediately sends these values (Lat, Lon, Altitude, Pitch, Bank, Heading) to your FSUIPC7 => MSFS. In the meantime, the above-mentioned small program continually sends assigned runway initial position (Lat, Lon, Altitude, Pitch, Bank, Heading) to FSUIPC7=>MSFS. Send, Send, Send to MSFS ....... In the meantime, MSFS is also making some its initial settings. 4) When Ready to Fly occurs on MSFS screen, Press Ready to Fly! In this moment, MSFS captures (receives) the assigned runway initial position (Lat, Lon, Altitude, Pitch, Bank, Heading) from FSUIPC7 and locates the runway (scenery) at expected position. Then begin to fly according to our simulation program. Problem: We do not need the aircraft on the screen (Scenery). However, We do not know how to remove (turn off) the aircraft from the screen (Scenery). Have you some ideas to remove (turn off ) the aircraft from the screen (Scenery)? THANKS, John! Dengxie
  11. I do not know how to set (operate) on MSFS to what case, so that MSFS is waiting for our input values (Lat, Lon, Altitude, Pitch, Bank, Heading) through FSUIPC7 .
  12. John, Thanks for your reply! Our application in FSX and P3D works in the following way: 1) Press "Start" FSX or P3D (in the same time also start your add on FSUIPC6) 2) FSX or P3D (also your FSUIPC6 ) is waiting for ....... 3) Start our small program (coped from your example program) to run on the Visual computer: The small program receives Lat, Lon, Altitude, Pitch, Bank and Heading from LAN (UDP) and immediately sends these values (Lat, Lon, Altitude, Pitch, Bank, Heading) to your FSUIPC6 => FSX or P3D. Note: Without Aircraft on the Screen (Scenery). 4) FSX or P3D continually receives the Lat, Lon, Altitude, Pitch, Bank, Heading to locate the Visual Scenery (Runways) at assigned positions of our simulator. We want to MSFS to work the same way. ----------------------------------------------------------------------------- Using the above-mentioned complete same program (way), we also can send Lat, Lon, Altitude, Pitch, Bank, Heading to MSFS through your FSUIPC7 to see the Scenery movement. However, this initial process can NOT be started from our assigned initial Runway. Best Regards! Dengxie
  13. John said: "But when in the main menu, there is no aircraft, airport, Lat, Lon, etc. You set this up in the main menu." Just as I said before, MSFS 2020 is only used as the Visual Scenery for our simulators. We do not need the aircraft, airport, runway, Lat, Lon, Altitude, Pitch, Bank, Heading provided by MSFS or set on MSFS! MSFS is only waiting for our program to send the airport, runway, Lat, Lon, Altitude, Pitch, Bank, Heading at the Visual Scenery (WITHOUT AIRCRAFT on the screen to fly). FSX and P3D work in this way. This only is the clarification for our application. THANKS John!
  14. THANKS, THANKS, THANKS John! I will work on MSFS, according to your suggestion. Best Regards! Dengxie
  15. John: Very many thanks for your detailed answer. I will test our application according to your suggestion. If it is convenient for you, I expect to get your further help for the following questions: 1) How to get your "Quote log"? I also want to know the start-up sequence of MSFS. 2) Just as I said before, MSFS 2020 is only used as the Visual Scenery for our simulators. For P3D, after press "start", our program begins to send Lat, Lon, Altitude, Pitch, Bank, Heading to FSUIPC6 => P3D, to locate the initial runway (Scenery) at any positions in the world. Then we start our simulation program to fly. Likewise, we want to MSFS 2020 works in the same way. After Starting MSFS with FSUIPC7, we wait for the MSFS to enter the main-menu: WELCOME, WORLD MAP, FLIGHT TRAINING,......! Question: In this case (screen), now what sequence settings are needed first to send to FSUIPC7 => MSFS? so that we can locate the initial runway (Scenery) at any positions of MSFS in the world, then we start our simulation program to fly. Should we send 0x0262 value 0 to set for un-pause? THANKS for your Help!
  16. THANKS Mr. John Dowson! I use the following program to get 0X3364 and 0X3365 values. uint8 Indicator = 8; uint8 Indicator2 = 9; if (!FSUIPC_Read(0x3364, 1, &Indicator, &dwResult)) { printf("Read Error \n"); } else { FSUIPC_Process(&dwResult); printf("Indicator = %d ", Indicator); } if (!FSUIPC_Read(0x3365, 1, &Indicator2, &dwResult)) { printf("Read Error \n"); } else { FSUIPC_Process(&dwResult); printf("Indicator2 = %d \n", Indicator2); } --------------------------------------------------------------------------- After starting FSUIPC7 with MSFS, I get the MSFS WELCOME page: WORLD MAP, FLIGHT TRAINING, ......, My above-mentioned program reads FSUIPC7 and gets Indicator (0X3364) = 0, Indicator2 (0X3365) = 0. then, my program sends initial Runway positions Lat, Lon, Altitude, Pitch, Bank, Heading to FSUIPC7=> MSFS 2020, however, MSFS 2020 no reaction to the sending position. What is my problem? Please you help me, THANKS!
  17. THANKS Mr. John Dowson! You always answer my questions quickly and give me great help! "to determine the state of MSFS (connected or not, pause state, in main menu) and the aircraft state. " What means your "main menu"? Is the "main menu" on MSFS ? Best Regards!
  18. After FSUIPC7 with MSFS 2020 is started, what status MSFS 2020 should be set (operated) to wait for FSUIPC7 to input Lat, Lon, Altitude, Pitch, Bank, Heading? In other words, after FSUIPC7 with MSFS 2020 is started, what status MSFS 2020 should be set (operated) ? then to start our program to begin to send Lat, Lon, Altitude, Pitch, Bank, Heading to FSUIPC7-> MSFS 2020? THANKS for your Help and Supports!
  19. Hi, We have been using FSUIPC4 and FSUIPC5 to add on FSX and P3D, and the FSX and P3D are used only as the Visual Scenery for our simulators. Our same program to communicate with FSUIPC4 to FSX or to communicate with FSUIPC5 to P3D, works very well. It means that our program can send Lat, Lon, Altitude, Pitch, Bank, Heading to locate FSX and P3D at any assigned positions, once FSX and P3D are started. Likewise, we are now using FSUIPC7 with MSFS 2020, and MSFS 2020 is used only as the Visual Scenery for our simulators. Question: After FSUIPC7 with MSFS 2020 is started, our same program to communicate with FSUIPC7 to MSFS 2020. Our program sends Lat, Lon, Altitude, Pitch, Bank, Heading to FSUIPC7 with MSFS 2020 as Runway initial position , however MSFS 2020 Scenery can not well be located at the assigned Runway initial positions (Lat, Lon, Altitude, Pitch, Bank, Heading). THANKS for your Help and Supports!
  20. THANKS Pete! What is my problem as follows error message: ”The code exection cannot proceed because VCRUNTIME 140_1.dll was not found. Reinstalling the program may fix this problem" BEST REGARDS!
  21. Hello Pete, I have been working on your FSUIPC4, FSUIPC5 and FSUIPC6 for FSX and P3D. I have used your example program C to communicate with FSX and P3D, no problem. Today, I installed Microsoft Flight Simulator 2020 and FSUIPC7. Microsoft Flight Simulator 2020 can work well, but I do not know how to add on the FSUIPC7 to Microsoft Flight Simulator 2020. It seems that after installing FSUIPC7, the FSUIPC7 is not automatically to add on the Microsoft Flight Simulator 2020. I request you to help me: How to add on the FSUIPC7 to Microsoft Flight Simulator 2020? THANKS!
  22. Hello Pete, Thank you very much for your help. I will check the values. Best Regards! Dengxie Yin
  23. Dear MR. John Dowson, Thank you very much for your help. Today, my program reads offset x0020 (4 bytes) or 0x0b4c (2bytes) to get GROUND ALTITUDE, but these ground altitude values ONLY to show current runway elevation. During flying, reading GROUND ALTITUDE values always are same as the runway elevation, no change. What is my mistake? Thanks and Best Regards! Dengxie
  24. Dear MR. John Dowson, THANKS FOR YOUR HELP! I will read the values and test it tomrrow. Good Night and Best Regards! Dengxie
×
×
  • 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.