-
Posts
82 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by jd
-
-
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
-
fstarrc is a little program pete wrote that takes fstar flight plans, and creates a file that radar contact use. (that's what the rc is for at the end)
jd
-
vb is really easy to do things.
use this formula
heading = (hdg_you_want / 360 * 65536)
and then do your write with heading
jd
-
here's my code. what aren't you happy with? how much difference is there?
Public Function Ground_Altitude() As Single ' meters Altitude MSL of ground under plane.
Dim x As Long
Dim Y As Single
Dim dwResult As Long
Call FSUIPC_Read(&HB4C, 2, VarPtr(x), dwResult)
Call FSUIPC_Process(dwResult)
Y = x
If Y > 32767 Then Y = Y - 65534
Ground_Altitude = Mtof(Y)
End Function
-
writing something from scratch here
say you want a 12 byte string
dim t as string
dim s(12) as byte
Call FSUIPC_Read(&H3D00, 12, VarPtr(s(1)), dwResult)
Call FSUIPC_Process(dwResult)
t = ""
For j = 1 To 12
If s(j) = 0 Then Exit For
t = t & Chr(s(j))
Next j
MsgBox s
-
writetxt - "test"
writetxt = Left(writetxt , 127)
writetxt = writetxt & vbNullChar
j = 4
Call FSUIPC_WriteS(&H3380, Len(writetxt ), writetxt , dwResult)
Call FSUIPC_Write(&H32FA, 2, VarPtr(j), dwResult)
Call FSUIPC_Process(dwResult)
-
-
use fsuipc_writes
jd
-
don't know how to do that
-
Public Function Plane_Lat() As Double ' Planes latitude
Dim fake64bit As Currency
Dim dwResult As Long
Call FSUIPC_Read(&H560, 8, VarPtr(fake64bit), dwResult)
Call FSUIPC_Process(dwResult)
Plane_Lat = fake64bit * 10000#
Plane_Lat = Plane_Lat * 90# / (10001750# * 65536# * 65536#)
End Function
Public Function Plane_Lon() As Double ' Plane's longitude
Dim fake64bit As Currency
Dim dwResult As Long
Call FSUIPC_Read(&H568, 8, VarPtr(fake64bit), dwResult)
Call FSUIPC_Process(dwResult)
Plane_Lon = fake64bit * 10000#
Plane_Lon = Plane_Lon * 360# / (65536# * 65536# * 65536# * 65536#)
End Function
-
let's see the code. your read the center fuel capacity, not fuel in the center tank, you know? does your plane have a center fuel tank?
-
if your fsuipc read is gettin a 2byte, use integer , 4byte use long. etc. seems my code should have used an integer. but, it works :-)
y is single, because i'm returning ground altitude as single
the if statement is for the occasional elevations below sea level. negative numbers are not represented as negative numbers, but really big numbers above 32767
try making cntrfuel a long
jd
-
your code is going to set gndalt to 0 (since the integer of (3.28084/ 256 = .01281578125) = 0)
here is the code i've used for about 8 years
Public Function Ground_Altitude() As Single ' meters Altitude MSL of ground under plane.
Dim x As Long
Dim y As Single
Dim dwResult As Long
Call FSUIPC_Read(&HB4C, 2, VarPtr(x), dwResult)
Call FSUIPC_Process(dwResult)
y = x
If y > 32767 Then y = y - 65534
Ground_Altitude = Mtof(y)
End Function
Public Function Mtof(meters As Single) As Single ' Convert Meters units to Feet
Mtof = (meters * 3.28083989501312)
End Function
-
the only thing i see is the extra set of parentheses in the next to the last line of code. everything else looks dandy
-
the key is the & at the end
change that, and it will probably work.
jd
-
you could also change the radar contact keys, 1-5 to ctrl-shift-1-5
jd
-
all my flt's have pln's. i just assumed others would do a .pln before saving a .flt
jd
-
since you can get the .flt file name, you can read the .flt file, and look for
[GPS_Engine]
Filename=F:\jdekker\Documents\Flight Simulator Files\ktpa-kmlb
then you can open that file up, and read the flight plan
jd
-
sorry i missed it
here is my code snippet:
Function adv_disp(Text As String, duration As Long)
Dim dwResult As Long
Dim j As Long
Dim s As String
s = Left(Text, 127)
s = s & Chr$(0)
Call FSUIPC_WriteS(&H3380, Len(s), s, dwResult)
j = duration
Call FSUIPC_Write(&H32FA, 2, VarPtr(j), dwResult)
Call FSUIPC_Process(dwResult)
End Function
-
i have 3.253 and fs2000 installed and running. anything i can test for you?
-
maybe you haven't heard of radar contact (http://www.jdtllc.com). no need to wait :lol:
-
oh, i thought you needed to get the speed too. i'm off to my wife's foot surgery, i'll return later
jd
-
maybe this will help
Public Function Velocity() As Single ' knots Plane's current groundspeed.
Dim x As Long
Dim dwResult As Long
Call FSUIPC_Read(&H2B4, 4, VarPtr(x), dwResult)
Call FSUIPC_Process(dwResult)
Velocity = (x / 65536) * 3600 * 3.28084 / 5280
End Function
Public Function Velocity_Indicated() As Single ' knots Indicated airspeed.
Dim x As Long
Dim dwResult As Long
Call FSUIPC_Read(&H2BC, 4, VarPtr(x), dwResult)
Call FSUIPC_Process(dwResult)
Velocity_Indicated = x / 128
End Function
Public Function Velocity_Y() As Single ' meters/second Vertical speed rate
Dim x As Long
Dim dwResult As Long
Call FSUIPC_Read(&H2C8, 4, VarPtr(x), dwResult)
Call FSUIPC_Process(dwResult)
Velocity_Y = x * 60 * 3.28084 / 256
End Function
-
as soon as i get back from work, i'll post my routine to read aircraft id
VB
in FSUIPC Support Pete Dowson Modules
Posted
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