Mr.Computer Posted October 10, 2005 Report Posted October 10, 2005 Hello, I'm newbe and I want to ask some questions. I am programmer in VB(Visual-Basic), and I want to get and send information from and to the FS. Some said to me that FSUIPC will do the best. But, unfortunately I don't know even clew for how and where to start. Maybe, someone can show me a guid that explains how to start(from connecting to FS and how to connect to FS), and to explain me how I can get information about the plane status(fuel, altitude, on ground, engine start, engine shut-down, aitborn, landed and so more). Thank for all, and especially for who will help me. Nahi.
Mr.Computer Posted October 10, 2005 Author Report Posted October 10, 2005 Okay, I found the SDK, FSI2 and the guid made by our dear friend, pete, thanks to all that wanted to help me. If I shall have more questions, I shall ask here. Thanks and good night(or morning? :shock: ) to all. Signed by Nahi.
Mr.Computer Posted October 10, 2005 Author Report Posted October 10, 2005 Hello again, I tried to do what had been wrote at the guid by Pete(with the example in VB) but, when I tried to get time, at first it shoed me the error 9, so I tried to do an FSUIPC_Open sentence, but then I got error no. 1 Here is the code as follow: Private Sub Timer1_Timer() Dim dwResult As Long Dim auiTime() As Byte ReDim auiTime(3) If FSUIPC_Read(&H238, 3, VarPtr(auiTime(1)), dwResult) Then If FSUIPC_Process(dwResult) Then lblTTIme = Format(auiTime(1), "00") & ":" & _ Format(auiTime(2), "00") & ":" & _ Format(auiTime(3), "00") Else lblTTIme = "Err Prc:" & ResultText(dwResult) End If Else lblTTIme = "Err Rdn:" & dwResult End If End Sub What Do I need to do to solve this problem?. As signed by Nahi.
Mr.Computer Posted October 11, 2005 Author Report Posted October 11, 2005 Could someone help me here? :?:
Mr.Computer Posted October 11, 2005 Author Report Posted October 11, 2005 OKay, I solved the problem. But now, there is another one. I am trying to check if the doors in Cessna are open, It always just saying the doors are open(with the num 0). I don't know what to do, maybe something with the connection? Here is the code as follow: Private Sub Timer1_Timer() Call FSUIPC_Initialization If FSUIPC_Open(SIM_ANY, dwResult) Then Dim DoorS As Variant Dim DoorStatus As String Call FSUIPC_Read(&H3367, 1, VarPtr(DoorS), dwResult) Call FSUIPC_Process(dwResult) If DoorS = 0 Then DoorStatus = "Open" ElseIf DoorS = 1 Then DoorStatus = "Close" End If lblDoorStatus.Caption = DoorStatus Else lblDoorStatus.Caption = dwResult End If End Sub The code doesn't repeating error number, it always just writes "Open". Thank in advance(If someone will help me... :roll: )
Pete Dowson Posted October 13, 2005 Report Posted October 13, 2005 I am trying to check if the doors in Cessna are open, It always just saying the doors are open(with the num 0). Two points: 1. In offset 3367 at present only bit 0 is used for doors (in FS2004). In case other indications are added in future you should check for bit 0 only ( and logically AND with 1). 2. The bit is set to 1 if the doors are Open, so you are interpreting it in reverse. Dim DoorS As Variant Dim DoorStatus As String Call FSUIPC_Read(&H3367, 1, VarPtr(DoorS), dwResult) What is a "Variant"? The value is a simple byte or character. You could read it into an integer, but set that to zero first to avoid confusion in the parts not read into. Regards, Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now