PDA

View Full Version : send pitch degree to FSX using VB6 Help



sinan
02-13-2013, 04:30 PM
hi everybody

first of all special thanks all members of form and Jim
I have learned a lot off things. (sorry about my bad english)

Anyway I try to send pitch degree to fsx using program which I take SIMCONNECT FSX output Link2fs VB6 Visual basic 6 source code fs9 fs2004 vb.net com port serial fsconnect simconnect (http://www.jimspage.co.nz/fsxfs9inouts.htm) page. But I havent been successful. could you please help me.
The code bellow (Jims wrote) gets pitch degree data from fsx but how can I send pitch degree to fsx bassicaly. I need only send pitch degree command line using vb6

Where and what I write to send forexample 30 degree pitch for dive or climb aircrafts. thank you

Private Sub Form_Load()
SimConnect.Open "FSCSimConnect", 0
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 1001, "PLANE PITCH DEGREES", "degree", SIMCONNECT_DATATYPE_FLOAT64
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
pitch.Caption = pch
Case 9998

End Select
End Sub

sinan
02-14-2013, 04:45 PM
please help me

Jim NZ
02-15-2013, 04:32 AM
I've answered your PM so have a check there ,,, Jim