Jump to content
The simFlight Network Forums

BoXon

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by BoXon

  1. Everything went just fine until a friend of mine discoverd a bug in the program, it thinks that the aircrafts longitude is 243 degrees while it actually is 116 degrees. No problem in europe, the position report in the program is correct, this bug occured while my friend was flying in western canada. Anybody know how to correct it? A code sample: Dim lon As Offset(Of ULong) = New FSUIPC.Offset(Of ULong)(&H568) ... 'Longitude= Dim real_lon As Double real_lon = lon.Value * 360.0 / (65536.0 * 65536.0 * 65536.0 * 65536.0) lon_label.Text = real_lon
  2. I was just confused, now that i know what the documentation means i have no problem! Thanks for your help! :D
  3. That is all the info i got. I searched all the pdf's for any information about how to use the value, as the value wasn't 0x1200 for the code "1200" i didn't know what to do. :(
  4. Oh thanks! Actually, i searched for transponder in every document i could find in the SDK without any result. :(
  5. Hi! Maybee someone can help me with reading from offset 0354? I'm trying to read the transponder (currently "1200"), but my application returns "4608". :? 'Declaring... Dim xpdr As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H354) ... ' Code to show transponder xpdr_label.Text = xpdr.Value
  6. Hello! Does anyone know if there is possible to start a flight in FS through my own application at a certain time, airport and with a specific aircraft? Like, i'm having a button -> "Start FS at XXXX with PMDG747 at 2009-02-24 13:30", this would start FS, loading the PMDG747 at the airport XXXX (converted to long/lat positions of course?) with the current time set to: 2009-02-24 13:30. Don't know if this has anything to do with FSUIPC, but as this is a great forum with alot of experienced programmers, maybe someone could help anyway. :) Thanks!
  7. Yup, i just found out that i had to get the mag-varition after my post. :D
  8. Well, atleast i got it to read something. But my heading is 224, but my code reads -117,735343845561 What am i doing wrong? :? Imports FSUIPC Public Class Form1 Dim hdg As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H580) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ' Attempt to open a connection to FSUIPC (running on any version of Flight Sim) FSUIPCConnection.Open() ' Opened OK Timer1.Enabled = True Catch ex As Exception ' Badness occurred - show the error message MessageBox.Show(ex.Message, "skyCARS", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick FSUIPCConnection.Process() Dim hdg2 As Double = hdg.Value * 360.0 / (65536.0 * 65536.0) Label1.Text = hdg2 End Sub End Class
  9. Hello! I have now successfully connected to FSUIPC, but a problem occurs then i'm trying to read values: Error 1 Constant expression not representable in type 'Integer'. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick FSUIPCConnection.Process() Dim hdg As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H580) Dim hdg2 As Double = hdg.Value * 360 / (65536 * 65536) Label3.Text = hdg2 End Sub Using VB 2008 Express
  10. Hi! Is there any VB2008 version of the FSUIPC.bas that makes it possible to connect to connect to FSUIPC via my VB2008 application? I got a version that works for old VB6, but when i import it into VB2008 it stops working. Please share the VB2008 version if you have! :wink:
  11. Thanks Pete! Will try them later this day, where can i find more information about these offsets? Can't find them in the "FSUIPC for programmers.pdf".
  12. Doesnt seem to work for me. :( The code turns red in VB6 and when trying to run it VB6 returns: Compile Error: Expected: end of statement
  13. Thank you very much! I will test it right away! :D
  14. Hey! Just a litle request, if anybody has a script to read the current remaining fuel of an aircraft in Visual Basic i would be very grateful if you shared it with me. Well, please share if you have a VB6 script that can read the fuel weight of an aircraft! Best Regards Patrik
  15. Copy and paste from someone else's bad code you mean? Regards Pete Yepp :wink:
  16. Hi Pete well, the "write" code is just a "copy & paste", but i'll try to change the "0" part. :)
  17. Hello once again! I have a little trouble sending messages to FS, realy odd... What happens is that the messages appears fine in FS, but each time it's updated (using a VB timer) it's changing style, so somtimes it's red and scrolling, somtimes it's white and not scrolling, sometimes it's red not scrolling and somtimes it's white and scrolling. I cannot understand why it's a "random" style? As you can se here in my code, everything should be correct for a standard "NON SCROLLING MESSAGE" ? Function paxBoarding(pax) If dwResult = "0" Then boardedPax = boardedPax + 1 If boardedPax <> pax Then main.logg.AddItem (boardedPax) If FSUIPC_WriteS(&H3380, 128, "Aircraft is boarding: " & boardedPax & " of " & pax & " passangers has boarded.", dwResult) And FSUIPC_Write(&H32FA, 2, VarPtr("0"), dwResult) And FSUIPC_Write(&H1274, 2, VarPtr("0"), dwResult) Then FSUIPC_Process (dwResult) Else main.logg.AddItem ("Boarding klart! " & boardedPax & " passagerare ombord") main.checkForFSTimer.Enabled = True End If End If End Function Please some VB-guru, help me solve this problem! :(
  18. Hey! I have a problem once again, i'm trying to read the current Longitude & Latitude of my aircraft in FS, but using this code:' Dim dwResult As Long Dim longfake As Currency Dim currentLong As Double Call FSUIPC_Read(&H568, 8, VarPtr(longfake), dwResult) Call FSUIPC_Process(dwResult) currentLong = longfake * 10000# currentLong = currentLong * 360# / (65536# * 65536# * 65536# * 65536#) longitude.Text = currentLong ------------------------------------------------------------------------------------------ It returns something like this: -123,029740092334 Thats not what i want? :shock:
  19. Hello! Is there any offset that reads the current status of how many engines that are currently running? Cannot find that offset in the "FSUIPC for programmers". :?
  20. Solved the problem by split the "dim's". Thank you Pete and LukeK! :) Pete, buy FSUIPC before the end of this month hopefully! :wink:
  21. Hmmm, an FSUIPC registration would help there then. I didn't realise you hadn't even bought FSUIPC! :-( Pete Nope, i only have the freeware key for the .exe recived from you. But i will buy it, cuse when i started to work with FSUIPC i discovered all the work included in it! Great work! :D Now it would be great if someone could help me getting my program working? 8)
  22. No, I mean do one (1) process call for ALL the reads you want to do this cycle, not just arbitrarily bach them still with multiple calls to FS for no good reason. would you take separate trips to the supermarket to get three different things if you knew you wanted them all before you went the first time? You only need to separate them if you need the results of one read to decide what else to read, or to decide upon something to write. But that's a VB error, and the VB compiler or debugger will tell you precisely what is wrong, surely? That is why you use such a terrible language (my opinion, of course), isn't it? Because it is supposed to be easy? Surely it doesn't give obscure compile or runtime errors with no explanation? Sorry, but I cannot help with VB. Try me on C. Maybe someone else will help, but if VB never tells you where it failed I don't see how you can use it in the first place. :-( Regards, Pete 3 different shops ? :wink: As the program key is in the .exe comment field, i can only test it outside VB, and then i complie it to an .exe i get no errors. :? I'm planning to begin with a C language, but thats after this program is ready. :)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.