Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I'm trying the status of the LEDs on PM MCP read. Programming language is VB-2013. 

I have the offset declared as SHORT because it has 2 bytes.

Public LED As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H4F0)

How do I get the status of each LED in VB?

04F0         2 MCP/FCU Lights (Read Only)

Bit Light 
0  A/P Master L (1)  
1  A/P Master C (2)  
2  VS  
3   ALT HLD  
4   APP  
5   LOC  
6   LNAV  
7   HDG  
8   FLCH  
9   SPD  
10 THR  
11 A/T  
12 F/D  
13 A/P Master R  
14 VNAV 

I am grateful for any help :)

Posted

The easiest way is to set the type as a BitArray: (You also need to add the offset length as the second parameter.)

    Public LED As Offset(Of BitArray) = New FSUIPC.Offset(Of BitArray)(&H4F0, 2)

To read the state of a particular light just use an array index with the bit number you need.

 

For example this is how you know if the LNAV light is on or off:

        FSUIPCConnection.Process()        Dim lnav As Boolean = LED.Value(6)

Paul

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.