Jump to content
The simFlight Network Forums

Toppa80

Members
  • Posts

    19
  • Joined

  • Last visited

About Toppa80

  • Birthday 01/01/1970

Profile Information

  • Location
    Mönchengladbach

Toppa80's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you again for your answers. This type of programming is a bit new for me. @ Pete: I work with the example from SDK. It is pretty good. And I found my problem now. It was exact that, what Phenty now wrote down. I think, that I will now unterstand the situation better now. Sorry for the stupid answers from my side, but as I said, it´s new for me. I still have to learn, where to search and how I should ask, that you better understand me question ;) @ Phenty: Thank you too Have a nice and thank you. Pete, you do a really great job! Tobias
  2. Thank you both for your help. I will see the FSI documentation aswell as the DLL documentation. Is there another possibility to read FSUIPC? I can´t find any other example code for VB.NET. Greetings, Tobias
  3. Hi Folks, I have a general question about using the variables from FSUIPC. I use Visual Basic 2008 Express Edition. In an example Code I found this to use the Variables: Public FlagReadyToFly As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H3364, 256) But I don´t get the correct values, which should be.... If you are in the initially menu, it should give you 255. FSInterrogate says. it is a U8-Type with size 1. How else can I use the variable 3364? Please Help me! I think I make a general mistake. Thank you, Tobias
  4. I´m sorry ;) Hi, I have a problem.... the offset 3364 "Flag ReadyToFly" shows 0 while flying, 2 while I´m in the StartUp Menu and 3 while going to a menu in flightmodus. So far so good... I found a bug: Being in the StartUp Menu "Create Flight" and going to the menu to change aircraft, the flag shows 0. This not happens anywhere else, only there. My Application is in stby and waits for 0 on "ReadyToFly" flag. If I now change the aircraft, it begins to run... The flag 3365 "InMenu" shows all the time 0. Does it only work on FSX? I hope anybody can help me. Sorry for my english ;) Greetings, Tobi
  5. Hi, ich habe da ein Problem.... das Offset 3364 "Flag ReadyToFly" zeigt 0 wenn ich fliege, 2 wenn ich im Startmenü bin und 3 wenn ich im Flugmodus in ein Menü gehe. Soweit alles in Ordnung... Habe einen Bug gefunden: Wenn ich vom Startmenü "Flug erstellen" in das Menü gehe um das Flugzeug zu wählen, zeigt es 0. Dies passiert in keinem anderen Menü, sondern nur da. Mein Programm ist in einem Stby-Modus und wartet darauf, dass es 0 wird. Wenn ich nun ein Flugzeug wähle, legt es aber los... Die Flag 3365 "InMenu" zeigt hier immer 0 an. Funktioniert das dann erst ab dem FSX? Würde mich sehr über eine Hilfe freuen. Liebe Grüße, Tobi
  6. Hey gjpollitt, sorry, I don´t know your real name. Thank you very much for your halp. I`m pretty new in VB. But now it works! The complete time is sent to the simulator. Have a nice weekend, Tobias
  7. Oh shit, I´m sorry!!!!! ;) Thank you very much for your code! The Time and the Day of the year works perfectly now :) Only the year doesn´t work :( "OverFlowException was not treated". -> The arithmetic operation caused an overflow. What can that be now? Public Class Form1 Public FSHour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23B) Public FSMin As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23C) Public FSSec As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23A) Public FSDoY As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23E) Public FSYear As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H240) Private Sub btnStartFsTimer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartFsTimer.Click FSHour.Value = Date.UtcNow.Hour FSMin.Value = Date.UtcNow.Minute FSSec.Value = Date.UtcNow.Second FSDoY.Value = Date.UtcNow.DayOfYear FSYear.Value = Date.UtcNow.Year FSUIPCConnection.Process("fstime") End Sub End Class The value Date.UtcNow.Year affords 2008, but doesn´t get taken over by FSYear.Value :( I hope, it´s better now ;) Regards, Tobi
  8. Hey, vielen Dank für deinen Quellcode. Die Zeit und auch der Tag wird jetzt perfekt übernommen :) Nur mit dem Jahr passt noch etwas nicht... Da meldet er immer "OverFlowException wurde nicht behandelt". -> Die arithmetische Operation hat einen Überlauf verursacht. Woran kann das nun noch liegen? Public Class Form1 Public FSHour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23B) Public FSMin As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23C) Public FSSec As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23A) Public FSDoY As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H23E) Public FSYear As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H240) Private Sub btnStartFsTimer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartFsTimer.Click FSHour.Value = Date.UtcNow.Hour FSMin.Value = Date.UtcNow.Minute FSSec.Value = Date.UtcNow.Second FSDoY.Value = Date.UtcNow.DayOfYear FSYear.Value = Date.UtcNow.Year FSUIPCConnection.Process("fstime") End Sub End Class Der Wert Date.UtcNow.Year liefert 2008, wird aber nicht in die Variable FSYear.Value übernommen :( Liebe Grüße, Tobi
  9. Pete, thank you very much, that you bear so much with me. I will try to find more infos to solve the problem. I will write it down here when so happened. Have a nice day. Tobias
  10. Pete, you are right. I thought I have it. I was wrong. It still doesn´t work. This is the for example the Zulu-Hour I want to write into the Flusi: Dim fs_H As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H23B, 1) Thats the way I get the time: Dim new_H As Integer = Date.UtcNow.Hour.ToString I´ve read, that I can get the data into the FSUIPC like that: fs_H.Value = ????? FSUIPCConnection.Process() The .Value must be a byte, right? But how to code it? I can´t find any help in the web :( Thank you, Tobias
  11. I solved the problem now. The String must be converted into CHAR.... Dim new_H As Char = "22" fs_H.Value = System.Text.Encoding.Default.GetBytes(new_H) This works now :) Thanks
  12. Pete, thanks for your answer. I tried it now that way, but it doesn`t work Dim new_H As String = "22" fs_H.Value = System.Text.Encoding.Default.GetBytes(new_H) I work with Visual Basic 2008. Thanks for your help, Tobias
  13. Thank you Robin for your help. I didn´t really used your code, but you brought me to an other idea. The problem was, that once the FSUIPCConnection.Open() was used, I have to close before next use... See the code: Private Sub StbyTimerForFsuipc_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StbyTimerForFsuipc.Tick If FSUIPC_CONN_OPEN Then Exit Sub Try FSUIPCConnection.Open() FSUIPC_CONN_OPEN = True Me.StbyTimerForFsuipc.Enabled = False Me.ToolStripStatusLabel1.ForeColor = Color.Green Me.ToolStripStatusLabel1.Text = "Connected to Flight Simulator" Me.bxtConnectedToFlusi.Text = 1 Catch ex As Exception Me.ToolStripStatusLabel1.ForeColor = Color.Orange Me.ToolStripStatusLabel1.Text = "Waiting for Flight Simulator" End Try If FSUIPC_CONN_OPEN Then Exit Sub FSUIPCConnection.Close() End Sub Greetings, Tobias
  14. Hi Folks, I have a problem with the connection to the FSUIPC. First I had a button. With a click on it, I started the connection to the FSUIPC, when the flusi was already running. Now I want to start my program first, in which I have a Timer, which tries to connect to FSUIPC. The flusi is not yet running. When I start the flusi now, it doesn´t find the FSUIPC. Do I start the program after flusi is running, it connects. What is the problem for that? Here is the Timer: Private Sub StbyTimerForFsuipc_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StbyTimerForFsuipc.Tick Try ' Attempt to open a connection to FSUIPC (running on any version of Flight Sim) FSUIPCConnection.Open() Me.ToolStripStatusLabel1.ForeColor = Color.Green Me.ToolStripStatusLabel1.Text = "Connected to Flight Simulator" Me.bxtConnectedToFlusi.Text = 1 Me.StbyTimerForFsuipc.Enabled = False Catch ex As Exception ' Badness occurred - show the error message Me.ToolStripStatusLabel1.ForeColor = Color.Red Me.ToolStripStatusLabel1.Text = "No Connection to Flight Simulator" End Try End Sub Thank you for help, Tobias
  15. Hi BoXon, this is my version. Might be a littlebit complicated, but it works... ' Left Tanks Quantity Dim FQ_gal_LM As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB80) Dim FQ_per_LM As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB7C) Dim FQ_gal_LA As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB88) Dim FQ_per_LA As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB84) Dim FQ_gal_LT As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB90) Dim FQ_per_LT As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB8C) ' Center Tanks Quantity Dim FQ_gal_C1 As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB78) Dim FQ_per_C1 As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB74) Dim FQ_gal_C2 As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H1248) Dim FQ_per_C2 As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H1244) Dim FQ_gal_C3 As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H1250) Dim FQ_per_C3 As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H124C) ' Right Tanks Quantity Dim FQ_gal_RM As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB98) Dim FQ_per_RM As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB94) Dim FQ_gal_RA As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HBA0) Dim FQ_per_RA As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HB9C) Dim FQ_gal_RT As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HBA8) Dim FQ_per_RT As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HBA4) ' Weights Dim weight_lbs_per_gal As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HAF4) then calculate all together... ' Fuel Density Dim weight_kg_per_ltr As Double = weight_lbs_per_gal.Value / 256 / 2.20462262 / 3.78541178 ' Fuel Quantity Left TANKS in Liter Dim FQ_Left_ltr As Double = ((FQ_gal_LM.Value * (FQ_per_LM.Value / 128 / 65536)) + (FQ_gal_LA.Value * (FQ_per_LA.Value / 128 / 65536)) + (FQ_gal_LT.Value * (FQ_per_LT.Value / 128 / 65536))) * 3.785411784 * weight_kg_per_ltr Me.txtFQ_Left_ltr.Text = FQ_Left_ltr.ToString("f2") ' Fuel Quantity CENTER TANKS in Liter Dim FQ_Center_ltr As Double = ((FQ_gal_C1.Value * (FQ_per_C1.Value / 128 / 65536)) + (FQ_gal_C2.Value * (FQ_per_C2.Value / 128 / 65536)) + (FQ_gal_C3.Value * (FQ_per_C3.Value / 128 / 65536))) * 3.785411784 * weight_kg_per_ltr Me.txtFQ_Center_ltr.Text = FQ_Center_ltr.ToString("f2") ' Fuel Quantity Left TANKS in Liter Dim FQ_Right_ltr As Double = ((FQ_gal_RM.Value * (FQ_per_RM.Value / 128 / 65536)) + (FQ_gal_RA.Value * (FQ_per_RA.Value / 128 / 65536)) + (FQ_gal_RT.Value * (FQ_per_RT.Value / 128 / 65536))) * 3.785411784 * weight_kg_per_ltr Me.txtFQ_Right_ltr.Text = FQ_Right_ltr.ToString("f2") ' Fuel TOTAL Quantity in Liter Dim fuelQuantity As Double = FQ_Left_ltr + FQ_Center_ltr + FQ_Right_ltr Me.txtFuelQuantity.Text = fuelQuantity.ToString("f2") I hope you can handle with my data. Greetings, Tobias
×
×
  • 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.