oldgreydog
10-11-2012, 06:45 PM
I know that people approach the planning and building of a flight sim cockpit as an entity in itself and enjoy the technical challenge of learning about all the various details of how systems work. I'm afraid I am not one of those people. My search is for as realistic an experience as possible when using FSX. I have good engineering/DIY skills (I'm an engineer by training) and a fair amount of IT/programming capability, but I don't want to have to get a PhD in SimConnect or FSUIPC.
I am planning a moving platform cockpit to use with FSX, but I can't seem to get past the first hurdle, namely how I get data out of FSX.
I have my own ideas about how I want the motion controller to be constructed so really what I am after is a C language function that will work with the FSX SDK Simconnect facility. Every time I start to delve into this I get neck deep into technical gobbledegook almost before I've started.
So does anyone have a C function I can copy, and know if there is anything I should be doing to FSX to get such things to work? I think I can do the rest and I'll make any software/systems I manage to develop freely available (with documentation) (I'm good at documentation - I just love one and two syllable words)
Tom_G_2010
10-12-2012, 09:02 AM
I'm not (at least for now) considering a motion platform for my sim. But for what I am doing I have not found any I/O that could be had with FSX out of the reach of Pete Dowson's FSUIPC when interfacing with a USB encoder. Have you looked at that?
Other apps that might be of interest could be Jim Page's Link2FS. I'm just looking into that one for a few possible FSX I/O solutions using an Arduino card. Or Alan Dyers FS2Phidgets for linking to phidget cards.
From what I've read so far of Link2FS it could potential talk to cards other than Arduino and Jim provides the data format so I would think you could adapt his app to talk to your controllers.
Another source with a particular focus on motion platforms and force feedback might be Ian at Build for Fun. BFF DIY Flight Simulator Motion Platforms and Force Feedback Systems. (http://bffsimulation.com/index.php) He has developed a motion platform and force feedback flight controls and supplies all the info, plans, and software on his sight.
Hope this helps!
oldgreydog
10-12-2012, 10:57 AM
Hi Tom_G_2010
Thanks for your reply. I had already looked at both of these sites and while they are interesting they are also not really what I am looking for. Both the Link2FS and the BFF software offerings are "turnkey" in that you can't get at the software to modify. What I really want is someone to tell me what "buttons to press and switches to flick" to get raw data out of FSX.
I actually have two elements to my project. Firstly I want be able to get the dynamic motion data to do my own platform motion calculations and secondly I want to be able to get avionics data out so I can reproduce the instrument panel using a second PC either on a vdu or if possible in hardware.
I am still looking at the SimConnect example routines particularly "Request Data" and I think I am starting to see how it is supposed to work. If I could actually get it to work that would be ideal as I could just modify its code, but unfortunately, so far I've not managed.
jonesthesoftware
10-12-2012, 02:06 PM
Hi
can't you use the FSX SDK?
Below is a section of the code I used in VB6 to connect to a Velleman 8055 board using the analogs to drive some electric motors on a scale model for proof of concept. All credit to JIM anda very early version of his Link2FS from which I unashamedely hacked some code . He has really put a tremendous amount of work into hia latest version.
7113
Public Sub Form_Load()
SimConnect.Open "FSCSimConnect", 0
Call open_channels
End Sub
Private Sub Form_Initialize()
DoNothing = False
n = 7
End Sub
Private Sub SimConnect_Opened(ByVal ApplicationName As String, ByVal ApplicationVersionMajor As Long, ByVal ApplicationVersionMinor As Long, ByVal ApplicationBuildMajor As Long, ByVal ApplicationBuildMinor As Long, ByVal SimConnectVersionMajor As Long, ByVal SimConnectVersionMinor As Long, ByVal SimConnectBuildMajor As Long, ByVal SimConnectBuildMinor As Long, ByVal Reserved1 As Long, ByVal Reserved2 As Long)
'SimConnect.AddDataDefinition 1000, "PLANE ALTITUDE", "Feet", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "PLANE PITCH DEGREES", "degree", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "PLANE BANK DEGREES", "degree", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "PLANE ALTITUDE", "Feet", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "PLANE HEADING DEGREES MAGNETIC", "degrees", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "GROUND VELOCITY", "Knots", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "PLANE ALT ABOVE GROUND", "Feet", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "ACCELERATION BODY Z", "Feet per second squared", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "ACCELERATION BODY X", "Feet per second squared", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "ACCELERATION BODY Y", "Feet per second squared", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "GEAR TOTAL PCT EXTENDED", "Percentage", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "TRAILING EDGE FLAPS LEFT PERCENT", "degrees", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "GENERAL ENG RPM:1", "RPM", SIMCONNECT_DATATYPE_FLOAT64
SimConnect.AddDataDefinition 1001, "SIM ON GROUND", "bool", SIMCONNECT_DATATYPE_INT32
SimConnect.AddDataDefinition 1001, "G FORCE", "GFORCE", SIMCONNECT_DATATYPE_FLOAT64
'SimConnect.AddDataDefinition 1004, "ATC HEAVY", "Bool", SIMCONNECT_DATATYPE_INT32
'SimConnect.AddDataDefinition 1004, "ATC MODEL", "", SIMCONNECT_DATATYPE_STRINGV
'SimConnect.AddDataDefinition 1004, "AI TRAFFIC ISIFR", "Bool", SIMCONNECT_DATATYPE_INT32
SimConnect.RequestDataOnSimObject 9999, 1001, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_SIM_FRAME, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED, 0, 0, 0
End Sub
Private Sub SimConnect_Quit()
MsgBox "FSX Closed"
End
End Sub
Private Sub SimConnect_SimObjectData(ByVal RequestId As Long, ByVal ObjectId As Long, ByVal DefineId As Long, ByVal Flags As FSCSIMCONNECTLib.SIMCONNECT_DATA_REQUEST_FLAG, ByVal EntryIndex As Long, ByVal EntryCount As Long)
Select Case RequestId
Case 9999
pch = Format(CStr(SimConnect.GetDataDouble(0, 0)), "0.0") 'pitch
rol = Format(CStr(SimConnect.GetDataDouble(0, 1)), "0.0") 'roll
ALT = Format(CStr(SimConnect.GetDataDouble(0, 2)), "000") 'altitude
HDG = Format(CStr(SimConnect.GetDataDouble(0, 3)), "0.0") 'heading
SPD = Format(CStr(SimConnect.GetDataDouble(0, 4)), "000") 'speed
agl = Format(CStr(SimConnect.GetDataDouble(0, 5)), "000") 'Above Ground Level
spa = Format(CStr(SimConnect.GetDataDouble(0, 6)), "0.0") 'SPEED ACCELL
rla = Format(CStr(SimConnect.GetDataDouble(0, 7)), "0.0") 'ROLL ACCELL
pca = Format(CStr(SimConnect.GetDataDouble(0, 8)), "0.0") 'PITCH ACCELL
ger = (Format(CStr(SimConnect.GetDataDouble(0, 9)), "0.00")) * 100 'GEAR POSITION
flp = Format(CStr(SimConnect.GetDataDouble(0, 10)), "000") 'flaps %
rpm = Format(CStr(SimConnect.GetDataDouble(0, 11)), "000") 'engine rpm
grd = Format(CStr(SimConnect.GetDataDouble(0, 12)), "0") 'on ground
gfc = Format(CStr(SimConnect.GetDataDouble(0, 13)), "0.00") 'G FORCE
regards
geoff
oldgreydog
11-02-2012, 07:18 PM
I have now solved the "getting data out of FSX" problem with much thanks to Dave Ault and his Learjet 45 Chimera website.
I am troubleshooting the Velleman 8055 that I finised soldering together a couple of days ago. (Soldering never was my strong point). Hopefully I will get it running soon. Then I'm going to try building a small scale mock up of the movement mechanism I'm proposing.
I had intended making a 3DOF platform, but I have decided to start off simpler and aim for a 2DOF with the possiblilty of upgrading.
My logic in doing this is that it should be possible to construct a balanced system tilting the platform longitudinally and laterally. This will require a lot less in power as the driving mechanism only has to overcome rotational inertia and not gravity (which comes into play as soon as you introduce vertical heave).