Skino2412 Posted April 2, 2022 Report Posted April 2, 2022 In the Offset PDF, FD Switch and Course Value are declared as such: 6520 4 WORD x 2 MCP_Course[2] 6538 2 BYTE x 2 MCP_annunFD[2] Boolean I can read Course1 with Dim CRS As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H6520) ... Label1.Text = CRS.Value and MCP_annunFD with Dim FD As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)(&H6538) ... If FD.Value = 0 Then RadioButton1.Checked = False Else RadioButton1.Checked = True End If The Value of FD is 0 or 1, depends on FlightDirectorSwitch 1. Switching FlightDirectorSwitch 2 does not change the value. How can I read Course2 and the FD LED 2? I do not understand the x2 and [2] in the offset description.
Paul Henty Posted April 2, 2022 Report Posted April 2, 2022 Quote I do not understand the x2 and [2] in the offset description. It just means that there are two of these offsets, one for each switch. So for the CRS switch the first one is at 6520, the second will be 2 bytes later (Short is two bytes) at 6522. For your flight director led, the first one is at 6538, the second one will be 1 byte later at 6539. You might find it easier to use the provided 737 Offsets class as all this is handled for you. You also won't need to code the offset declarations. To get the information you want you would use this code: 1. Create an instance of the PMDG 737 Offsets class at the form level: Dim PMDG737 As PMDG_737_NGX_Offsets = New PMDG_737_NGX_Offsets() 2. Refresh the data (like calling Process()) and read the offsets you want. All offsets are named like the offsets pdf. PMDG737.RefreshData() label1.Text = PMDG737.MCP_Course(0).Value label2.Text = PMDG737.MCP_Course(1).Value radioButton1.Checked = (PMDG737.MCP_annunFD(0).Value = 1) radioButton2.Checked = (PMDG737.MCP_annunFD(1).Value = 1) Note that if there is only one switch or display, you don't need the array accessor at the end. e.g. for the MCP heading it's just: lblHeading.Text = PMDG737.MCP_Heading.Value.ToString() Paul 1
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