-
Posts
82 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by jd
-
Error of heading variable (&H580) VB6
jd replied to Alejandro Lobo-Guerrero C's topic in FSUIPC Support Pete Dowson Modules
do it the math this way x / 65536 / 65536 * 360 -
you have to do some conversions here is my routine to set the plane at the proper lat/long/alt Public Function set_plane(lat As Single, lon As Single, alt As Single, hdg As Single) As Boolean Dim x As Long Dim dwresult As Long x = FTOM(CLng(alt)) Call FSUIPC_Write(&H574, 4, VarPtr(x), dwresult) x = lat * 10001750 / 90 Call FSUIPC_Write(&H564, 4, VarPtr(x), dwresult) x = lon * 65536 * 65536 / 360 Call FSUIPC_Write(&H56C, 4, VarPtr(x), dwresult) x = hdg * 65536 * 65536 / 360 Call FSUIPC_Write(&H580, 4, VarPtr(x), dwresult) Call FSUIPC_Process(dwresult)
-
VB - How to write key automatically to FSUIPC
jd replied to daniedelport's topic in FSUIPC Support Pete Dowson Modules
Call FSUIPC_WriteS(&H8001&, Len(fsuipckey), fsuipckey, dwResult) ' Call FSUIPC_Process(dwResult) where fsuipckey is a string containing the key (no spaces), concatenated with a null jd -
for the ai aircraft, that data is in the tcas tables. check the documentation for specifics jd
-
my vb does unsigned arithmetic :-)
-
you're probably overflowing the magvar variable i use MagVar = MagVar / 65536 * 360 what is the real magnetic variation where you're at? i'm betting that it is really -20, which will yield a number slightly higher than 360 so you will need a routine to take a heading that is larger than 360, and normalize it to a number between 0 and 359 jd
-
no idea, sorry jd
-
Function norm360(h As Long) As Long If h > 360 Then norm360 = h - 360 ElseIf h = 0 Then norm360 = 360 ElseIf h < 0 Then norm360 = h + 360 Else norm360 = h End If End Function
-
here is my code snippet Public Function Plane_heading() As Single ' degrees Plane's magnetic heading. Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H580, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Plane_heading = norm360((x / 65536 / 65536 * 360) - magvar) end function you may have to adjust for the magnetic variation, which is what magvar is (another function, to get the current magnetic variation) norm360 is a normalize function, which brings all heading to a range of 1-360 degrees
-
twenty degree magnetic variation would put you within 1 degree of the number you gave me jd
-
and what was the magnetic variation? jd
-
what was your plane heading?
-
i don't know what to say. this is the function i have used in radar contact since v3. it works, because i'm constantly checking the plane heading.. Public Function Plane_heading() As Single Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H580, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Plane_heading = x / 65536 / 65536 * 360 End Function
-
it's vb6, and the code has worked that way from v3.x through v4.x without a problem.
-
Public Function Plane_heading() As Single Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H580, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Plane_heading = x / 65536 / 65536 * 360 End Function
-
VB6 help with data types and offsets
jd replied to Graham Pollitt's topic in FSUIPC Support Pete Dowson Modules
for plane altitude, i use the following Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H574, 4, VarPtr(x), dwResult) 'meters Call FSUIPC_Process(dwResult) Plane_Alt = Mtof(CSng(x)) -
Press Release JDT LLC Announces Radar Contact Version 4 will begin shipping December 10, 2005. Flight Simulator will now have the best ATC at every airport, every hour, every day. Memphis, TN, November 11 2005: John Dekker and Doug Thompson report that Radar Contact Version 4 has been released to manufacturing, with an expected general availability of December 10, 2005. Radar Contact, a highly successful Flight Simulator ATC add-on, provides a realistic experience to Flight Simulator enthusiasts, wherever and whenever they fly. Version 4 offers: · Interaction with traffic on the ground and in the air around you. Realistic chatter to and from the traffic. · Internationalization – which means realistic Transition Altitude/Transition Level, proper phraseology outside the United States, more accurate ATC procedures. · Enroute holds now tied to arrival weather. · Support for pilot's discretion (PD) descent clearance from cruise to allow descents that are better aligned with those calculated by FMCs/CDUs. · Centers accurately divided into real world sectors. · More pilots, more controllers, 109 popular airport names recorded, over 700 carrier names recorded, all center names recorded, all aircraft types recorded. · More realistic crossing restrictions based on runway in use. Runways chosen based on AI activity. · More efficient arrival vectors. More information available at http://www.jdtllc.com
-
what is the value if sim_any when you call the fsuipc_open? breakpoint there, and hover the variable.
-
i'm assuming SIM_ANY is defined? i'm assuming fs is running when you try this button click? suggest you breakpoint at every fsuipc call, and make sure all your variables contain the right values, and find which call causes the error message jd
-
let's see the code
-
definately fsuipc_open, also test for slew = 1 not dwresult = 1
-
here is my code Public Function Plane_Bank() As Single Dim x As Long Dim dwResult As Long Call FSUIPC_Read(&H57C, 4, VarPtr(x), dwResult) Call FSUIPC_Process(dwResult) Plane_Bank = x / 65536 / 65536 * 360 End Function
-
i editted my post. the varialbe uiroll will contain the roll value in terms that are specified in the fsuipc sdk manual for programmers. dwresult simply is a variable used for success or failure
-
my best guess would be call fsuipc_read(&H057c,5,varptr(uiroll),dwreseult) call fsuipc_process(dwresult) you may have to do some math on the variable uiroll to get it in terms that you need jd