Jump to content
The simFlight Network Forums

friedrich

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Milan

friedrich's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Under " User Contribution " you can find a particular program that is doing things like that. Mouseclicks is a general application software and not only for a Flight Simulator. MouseClicks is acting on Joystick and Keyboard. Hope it can be of help.
  2. 'declare it only once on top - class/form level Dim APHeadingValue As Offset(Of UInteger) = New FSUIPC.Offset(Of UInteger)(&H7CC) ------------------------------------------------------------- 'could be done in a shorter and or different way Dim APHaeding As Integer APHeading = 350 (assign heading) 'whatever you calculate before, p.e. Hdg + a Wind-Drift-Value If APHeading > 360 Then APHeading = APHeading - 360 ElseIf APHeading < 0 Then APHeading = 360 + APHeading End If 'AP Heading Value in ° 16384 = 90° APHeading = APHeading * 182 If APHeading > 65536.0 Then APHeading = 65536.0 APHeadingValue.Value = APHeading 'set Hdg to AP
  3. Yes you are right. I forgot to mention it separately. Anyhow the import thing is the Timer1_Tick section for our friend 'djp122'. regards, Friedrich
  4. 1) download the latest download by Paul Henty 2) Read the complete VB.net example. FSUIPCClientExample_VB (Form1.vb) 3) Refer to the "Timer1_Tick" Section. You need the Timer Tick. Within this Timer Tick you declare for example: The Timer tick is reading data every 200 ms for example. Me.Timer1.Interval = 200 Me.Timer1.Enabled = True ecc..... ' COM2 frequency ' Shows decoding a DCD frequency to a string ' a. Convert to a string in Hexadecimal format Dim com2String As String = com2bcd.Value.ToString("X") ' b. Add the assumed '1' and insert the decimal point com2String = "1" & com2String.Substring(0, 2) & "." & com2String.Substring(2, 2) Me.txtCOM2.Text = com2String This is the way you get a continous update for all data you declare. You do not need any Button for it. You can read and Set all data. regards, Friedrich .
  5. I'm using this code for some KEY_EVENTS: Class Form1 Dim fsx_simconnect As SimConnect Const WM_USER_SIMCONNECT As Integer = &H402 .... Public Enum hSimconnect group1 End Enum Private Enum INPUT_ID 'should be used for sending Keyboard Input ? INPUT0 End Enum .... Private Enum EVENT_ID EVENT_APon EVENT_APoff EVENT_FLAPSup EVENT_FLAPSdn EVENT_ALTOnOff End Enum .... <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi, Pack:=1)> _ Structure Struct1 . '0 . . Public aponoffx As Single '7 <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public Titlex As String End Structure .... Private Enum DEFINITIONS Struct1 End Enum Private Enum DATA_REQUESTS REQUEST_1 End Enum Enum UPEVENT 'should be used for sending Keyboard Input ? WHATEVER End Enum Enum DOWNEVENT 'should be used for sending Keyboard Input ? WHATEVER End Enum ..... Private Sub btnconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handle btnconnect.Click 'EXAMPLE fsx_simconnect.MapClientEventToSimEvent(EVENT_ID.EVENT_APOnOff, "AP_MASTER") fsx_simconnect.MapClientEventToSimEvent(EVENT_ID.EVENT_APon, "AUTOPILOT_ON") fsx_simconnect.MapClientEventToSimEvent(EVENT_ID.EVENT_APoff, "AUTOPILOT_OFF") . . fsx_simconnect.AddToDataDefinition(DEFINITIONS.Struct1, "AUTOPILOT MASTER", "Bool", SIMCONNECT_DATATYPE.FLOAT32, 0, 7) . . . fsx_simconnect.RegisterDataDefineStruct(Of Struct1)(DEFINITIONS.Struct1) AddHandler fsx_simconnect.OnRecvSimobjectData, New SimConnect.RecvSimobjectDataEventHandler(AddressOf simconnect_OnRecvSimobjectData) fsx_simconnect.RequestDataOnSimObject(DATA_REQUESTS.REQUEST_1, DEFINITIONS.Struct1, SimConnect.SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD.VISUAL_FRAME, 0, 0, 0, 0) End Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If aponoff = 0 Then fsx_simconnect.TransmitClientEvent(DEFINITIONS.Struct1, EVENT_ID.EVENT_APon, 0, hSimconnect.group1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY) If aponoff = 1 Then fsx_simconnect.TransmitClientEvent(DEFINITIONS.Struct1, EVENT_ID.EVENT_APoff, 0, hSimconnect.group1, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY) End Sub Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ' Here should be the Transmit Key Event to the AUTOPILOT MASTER as a Example End Sub --------------------------------------- Everything is working OK. Several trials with different Forums explanations for sending Keystrokes via Simconnect unfortunately without success. I would need a precise Example how to implement the KEYSTROKE "Z" for the "AP MASTER" for example. I think it is also possible to send a combination of Keystrokes like "shift+h". Many thanks in advance. regards,
  6. Hi, there is a difference between VB 6 + VB 8. Manipulating was different using arrays. My question is: How Read + Write a single Flag value with Visual Basic 2008 ? Example: FSuipc - Offset 3366 - Var.Type U8 - Bit 0 .. 7 Thank you.
  7. Many thanks to you and Pete. In fact i noticed the Double + Integer values. Regards, Friedrich
  8. Many thanks for your quick answer. It would be nice if someone could supply the VB code for getting the right Compass Heading when Banking left or right. (like the wisky compass when flying straight) We have the following Offsets: Dim compass As Offset(Of Double) = New FSUIPC.Offset(Of Double)(&H2CC) ' compass Heading Dim truehdg As Offset(Of Double) = New FSUIPC.Offset(Of Double)(&H580) ' True Heading Dim magvar As Offset(Of Double) = New FSUIPC.Offset(Of Double)(&H2A0) ' Magnetic Variation Dim gyrodrift As Offset(Of Double) = New FSUIPC.Offset(Of Double)(&HC3E) ' Gyrodrift Many thanks in advance, Friedrich
  9. I have one question relating to the Wisky Compass Offset 02CC.<BR><BR>- Using VB 2008 - Timer set to a value of: 200 (even tried with different values)<BR><BR>Reading the Compass Value while:<BR><BR>1. flying with no Bank inclination - straight - compass value is correct.<BR><BR>2. changing the Bank inclination to the left - Compass Value is INCREASING<BR><BR>3. changing the Bank inclination to the right - Compass Value is DECREASING<BR><BR>It takes quite a lot of time to stabilize.<BR><BR>How can this be corrected in order to get a smooth reading like the GPS ?<BR><BR>Many many thanks in advance for your kind help.<BR><BR><BR>NB:<BR>i searched for a previous Forum Post and found 1 specific: <SPAN class=main_topic_title>Geting heading from FSUIPC with VB<BR><BR></SPAN>Is it possibile to get the VB code for a Hdg value like the GPS-Heading ?<BR><BR><BR><BR>Friedrich
  10. In fact my reference to offset 238 is just mentioned in order to show that other offset-readings with 'that' method (Dim .....) is working while the TCAS procedure does not. Now i will try it with the new DLL suggested by Paul Henty. thanks Friedrich
  11. Thanks for your answer Mr. Pete My VB program is working with all other Offsets. I get all single data as stated above like: Dim fsLocalDateTime As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H238, 10) FSUIPC is open. JUST the TCAS reading data Procedure is giving errors. There must be DECLARATIONS missing which are not a part of the VB basic language. Sure, the 'Connection' Error is easy to master with a boolean value. Maybe someone knows the way it should work. Anyway, many thanks Friedrich
  12. Using: - Visual Basic 2008 - FSUIPC unregistered - FSUIPC last update 4.7 ERROR LIST IS READING - Name Connected is not declared - FSUIPC_Read is not declared - FSUIPC_Get is not declared I would like to use the code found at the Link (year 2003): http://forum.simflig...dpost__p__34735 Normally i'm reading Offsets like: Dim fsLocalDateTime As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H238, 10) Someone can tell me what is wrong here and how can I make it working ? Many thanks for your kind help and assistance. Friedrich .
×
×
  • 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.