umituzun84 Posted April 1, 2009 Report Posted April 1, 2009 Hi Pete, I am naive on Microsoft Flight Sim and your FSUIPC4 tool to reach and control some parameters. I have downloaded FSUIPC_SDK.zip and FSUIPC4.zip new versions and I have MFS X on my system. My target is using C++ language get the only flight dynamics (i.e Pitch, Roll, Yaw, Planetary parameters) and send these information through network package to different machine which use this information to simulate the axis positions and orientations on 3D model. But in this situation I want to only Load dll from my application and import the needed functions and use this function on my system. Is it possible, if possible what should I start? I have confused so much in codes and your documents. Which document in Modules folder could help me so much? Please lead me a way. Best Regards. Umit Uzun
Pete Dowson Posted April 1, 2009 Report Posted April 1, 2009 I am naive on Microsoft Flight Sim and your FSUIPC4 tool to reach and control some parameters. I have downloaded FSUIPC_SDK.zip and FSUIPC4.zip new versions and I have MFS X on my system. My target is using C++ language get the only flight dynamics (i.e Pitch, Roll, Yaw, Planetary parameters) and send these information through network package to different machine which use this information to simulate the axis positions and orientations on 3D model. You could probably do all that using a simple Lua plug-in. Check the examples given -- particularly "record to csv.lua". You should be able to send the output to a named pipe instead of a file, and use the pipe over a network. If not, maybe I can add some extras to the library to enable this. But in this situation I want to only Load dll from my application and import the needed functions and use this function on my system. Is it possible, if possible what should I start? I have confused so much in codes and your documents. Which document in Modules folder could help me so much? None of the documents installed for you in the Modules folder have anything to do with programming in C++ or creating DLLs. You need a proper C++ reference and some notion of writing programs for Windows. Once you've mastered that, you'll need to find information on making a DLL work inside FS -- there's a little information around, but it isn't an officially supported method. FSUIPC is really designed to interface to external programs (EXEs), and there are examples of that in the SDK. Regards Pete
umituzun84 Posted April 2, 2009 Author Report Posted April 2, 2009 Hi Pete, Thanks for reply. I have looked at FSUIPC_SDK\UIPC_SDK_C directory and found FSUIPC_User.lib and FSUIPC_User.h file to support FSUIPC4 connectivity in our program. So I only want a create dll instead of FSUIPC_User.lib and FSUIPC_User.h files. Then I Load this dll in my application and use exported functions as SUIPC_Open or FSUIPC_Close by only using dll. Where can I get the source codes which belongs FSUIPC_User lib and header files. I look at same directory but there is only Lib_source.zip file in it but it isn't seem FSUIPC_User sources. Best Regards. Umit Uzun
Pete Dowson Posted April 2, 2009 Report Posted April 2, 2009 Thanks for reply. I have looked at FSUIPC_SDK\UIPC_SDK_C directory and found FSUIPC_User.lib and FSUIPC_User.h file to support FSUIPC4 connectivity in our program. So I only want a create dll instead of FSUIPC_User.lib and FSUIPC_User.h files. Sorry, this is not very clear. you want to create an FS DLL, or just a DLL to run inside your own EXE process? Then I Load this dll in my application and use exported functions as SUIPC_Open or FSUIPC_Close by only using dll. Right -- so you ARE talking about a separate process from FS? not a DLL running inside the FS process? Where can I get the source codes which belongs FSUIPC_User lib and header files. I look at same directory but there is only Lib_source.zip file in it but it isn't seem FSUIPC_User sources. Yes, the Lib_source.Zip is precisely what it says, it is the source from the LIB. Why do you think it is not? If contains all the LIB functions -- can you not see them in the C file? It was written in the days when Exports were declared separately in a DEF file (I think). These days you can to it with in-source declarations. cdecl export stuff. But if you know how to write DLLs you know all that stuff. Regards Pete
umituzun84 Posted April 2, 2009 Author Report Posted April 2, 2009 Sorry, this is not very clear. you want to create an FS DLL, or just a DLL to run inside your own EXE process? I only want to create my own exe project and I only use simple dll instead of lib and header in it. So I can only Load this dll in my project and use exported fuctions. Yes, the Lib_source.Zip is precisely what it says, it is the source from the LIB. Why do you think it is not? If contains all the LIB functions -- can you not see them in the C file? It was written in the days when Exports were declared separately in a DEF file (I think). These days you can to it with in-source declarations. cdecl export stuff. But if you know how to write DLLs you know all that stuff. I have seen all related function declarations in c file but I asked this question because of there is #include "FSUIPC_User.h" definition, so it makes me think it can be wrong definition. But I have grasped, it is true. Thanks. Regards
Pete Dowson Posted April 2, 2009 Report Posted April 2, 2009 I only want to create my own exe project and I only use simple dll instead of lib and header in it. So I can only Load this dll in my project and use exported fuctions. Okayone easy way to do that is to bind the LIB as it is into your DLL and export them there. You'd have a dummy DLLmain function which did little, and that's it. Or, as you suggest, use the supplied source and adapt it as you like. You could then change the retry system or the error reporting, as you wish. Regards Pete
umituzun84 Posted April 2, 2009 Author Report Posted April 2, 2009 Hi Pete, I will write Win32 dll and after finish send you, may be you add the current package. And I have another question with your courtesy. I want to get pitch, roll,yaw, planetary, heave and sled axes positions and velocity. I have glanced to the FSUIPC4 Offsets Status.pdf and find lots of offset related about them but I actually can't find which one of them are true. For example there is nothing about planetary axes. Microsoft calls different name for it I think. And what about the heave and sled positions and velocities. How can you call these axes? And I have tried to get and write data and find something odd. For example I read offset 3098 and get different result and one of them is this 18767422452136845000000000000000.000000 What do you think about this result, Do you think it would be accurate or not? I can't call this value. it is ft/sec and do you think I got the true result. FSUIPC_Read(0x3098, 8, &result, &dwResult) Thank you. Best regards. Umit Uzun
Pete Dowson Posted April 2, 2009 Report Posted April 2, 2009 I will write Win32 dll and after finish send you, may be you add the current package. Okay. Thank you! And I have another question with your courtesy. I want to get pitch, roll,yaw, planetary, heave and sled axes positions and velocity. I have glanced to the FSUIPC4 Offsets Status.pdf and find lots of offset related about them but I actually can't find which one of them are true. For example there is nothing about planetary axes. Microsoft calls different name for it I think. And what about the heave and sled positions and velocities. How can you call these axes? The 6 prime values in FS are "LLAPBH" == Latitude, Longitude, Altitude, Pitch, Bank and Heading. These are altogether starting at offset 0560. I don't know what you mean by planetary axes -- do you mean the velocities and accelerations relative to the world axes, perhaps? If so these are at offsets 3190 to 31D0 -- but there are no offsets for the rotational accelerations relative to world axes, only to the body axes. And I don't know "sled"? And I have tried to get and write data and find something odd. For example I read offset 3098 and get different result and one of them is this 18767422452136845000000000000000.000000.What do you think about this result I've no idea, but I suspect you are interpreting the 64-bit double float incorrectly. I think you need to check it with a reliable program such as FSInterrogate, or use the FSUIPC monitor facilities to display it on scree -- see the right-had side of the Logging tab. Do you think it would be accurate or not? I can't call this value. it is ft/sec and do you think I got the true result.FSUIPC_Read(0x3098, 8, &result, &dwResult) What are you reading it into? "result" obviously needs declaring as "double". Are you doing that? Regards Pete
umituzun84 Posted April 2, 2009 Author Report Posted April 2, 2009 The 6 prime values in FS are "LLAPBH" == Latitude, Longitude, Altitude, Pitch, Bank and Heading. These are altogether starting at offset 0560. I mean: Pitch : Pitch, Bank : Roll, Yaw : Heading, Heave : Y (vertical, or up/down) GS-velocity Sled : Z (longitudinal, or forward/backward) GS-velocity or X (lateral, or left/right) GS-velocity Planetary : Accumulated data which related of X (lateral, or left/right) GS-velocity, Y (vertical, or up/down) GS-velocity and Z (longitudinal, or forward/backward) GS-velocity I don't know what you mean by planetary axes -- do you mean the velocities and accelerations relative to the world axes, perhaps? If so these are at offsets 3190 to 31D0 -- but there are no offsets for the rotational accelerations relative to world axes, only to the body axes. Yes maybe my planetary is relative to the world axes but I am not sure what is the difference between world axes and body axes in MSFS. What are you reading it into? "result" obviously needs declaring as "double". Are you doing that? I had defined the result in float so the result have always gotten odd. I changed it with double and it's now so meaningful. Thanks so much. Best Regards. Umit Uzun
Pete Dowson Posted April 2, 2009 Report Posted April 2, 2009 The 6 prime values in FS are "LLAPBH" == Latitude, Longitude, Altitude, Pitch, Bank and Heading. These are altogether starting at offset 0560. I mean: Pitch : Pitch, Bank : Roll, Yaw : Heading Okay, you have those. Don't you recognise them? Heave : Y (vertical, or up/down) GS-velocity GS ground speed is not the same as VS vertical speed, but both are clearly available -- separately. Sled : Z (longitudinal, or forward/backward) GS-velocity or X (lateral, or left/right) GS-velocity Ah, by "GS-velocity" I think you don't mean "Ground speed", which is speed over the ground below, but relative to world coordinates. Right? And you have all those, they are clearly described. I've never heard of any of the normal velocities of a body being cllaed "sled". Where does that term come from? Planetary : Accumulated data which related of X (lateral, or left/right) GS-velocity, Y (vertical, or up/down) GS-velocity and Z (longitudinal, or forward/backward) GS-velocity Sorry, "accumulated"? You mean added up? This makes no sense! If you mean differentiated (as opposed to integrated) possibly you are talking about accelerations? I've already pointed you to those. Don't you care about rotational velocities and accelerations at all? Yes maybe my planetary is relative to the world axes but I am not sure what is the difference between world axes and body axes in MSFS. Body axes are they X,Y,Z orthogonal axes in the aircraft, the "body". So a sideways velocity would still be sideways no matter whether the aircraft were horizontal, vertical, otr what. The body velocities and accelerations are relative to the AIRCRAFT body, the pilot if you like. I had defined the result in float so the result have always gotten odd. I changed it with double and it's now so meaningful. Of course. "float" is only 32 bits and has a different number of bits in the exponent. Regards Pete
umituzun84 Posted April 3, 2009 Author Report Posted April 3, 2009 Hi Pete, Sorry for latency :) I have much work and I have created FSUIPC_User.dll to easy control in exe project. I am attaching it, if you have time please look at and if I have done wrong, you can warn me and I can fix immediately. GS ground speed is not the same as VS vertical speed, but both are clearly available -- separately. Thanks, I will try both of them. Ah, by "GS-velocity" I think you don't mean "Ground speed", which is speed over the ground below, but relative to world coordinates. Right? And you have all those, they are clearly described. I've never heard of any of the normal velocities of a body being cllaed "sled". Where does that term come from? I actually need relative to world coordinate front-back measurement changing in related flight time. So I can calculate the distance difference between these flight time so I can manipulate how much G(Gravity) effect the Pilot. I need this information to give the right effect to the Pilot in my Graphical Simulation. Sled doesn't come from anywhere, I only call front-back distance difference in each update time. I can represent by givin an example, when you push the gas pedal immediatly in the car, you are effected by the your car's direction's opposite direction force. I mean if your car is looking to X direction you are effected by -x direction force. So I need to calculate this force by using coordinate changing on each related time interval. Thanks so much. Best regards. Umit Uzun FSUIPC_User_DLL.rar
Pete Dowson Posted April 3, 2009 Report Posted April 3, 2009 ... I have created FSUIPC_User.dll to easy control in exe project. I am attaching it, if you have time please look at and if I have done wrong, you can warn me and I can fix immediately. Okay, thanks. I will be too busy till next week but will look at it then. I actually need relative to world coordinate front-back measurement changing in related flight time. All of the XYZ world velocities and accelerations are provided, as I pointed out, so you are okay. Don't use the body axes if you want world axes. If you need rotational accelerations in world axes you will have to compute those from the body rotational accelerations. Sled doesn't come from anywhere, I only call front-back distance difference in each update time. I can represent by givin an example, when you push the gas pedal immediatly in the car, you are effected by the your car's direction's opposite direction force. I mean if your car is looking to X direction you are effected by -x direction force. So I need to calculate this force by using coordinate changing on each related time interval. Ah, what you refer to as "differences in update time", we know as "acceleration". It is the acceleration, i.e. the rate of change in velocity, which is felt as force. "G-force" means "Gravity force" and is normally the force felt from the acceleration called gravity. So you want the three accelerations, as I thought. But if you want them to measure the feeling of forces on the pilot, you want the accelerations in the BODY axes, because the pilot is sitting IN the "body" of the aircraft and his left/right/up/down/forward/back are of course NOT the same as the World XYZ axes. Regards Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now