Jump to content
The simFlight Network Forums

request for sample application in VB.NET

Recommended Posts

After doing all my programming projects in VB so far,

I now switched to VB.NET

Is there any good sample application project available where I can study how offsets are read or written correctly in VB.NET ?

Thanks in advance

Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...

Its easy. Once you have connected to read stuff just call these functions:

FSUIPC_Read(offset, size, token, result)
FSUIPC_Get(token, value)

Offset (ie &H2342) and size are from the SDK and relate to the variable you are trying to read. Value is the actual final value. You need a different token for each variable you want to read.


FSUIPC_Read(offset1, size1, token1, result)
FSUIPC_Read(offset2, size2, token2, result)
FSUIPC_Get(token1, value1)
FSUIPC_Get(token2, value2)

And writes are simply:

FSUIPC_Write(offset, value, token, result)

Email if you want my .Net dll.

MOST important, remember to declare your variables as the same data type as specified in the SDK. ie if it says integer with length 2 then use int16 data type.


To register your app with FSUIPC

Dim token As Integer
Dim bytecode() As Byte
Dim a As New System.Text.ASCIIEncoding

'Insert your key in this line
bytecode = a.GetBytes("A4729AOCNPVU")

FSUIPC_Write(&H8001, bytecode.Length, bytecode, token, dwresult)

'if Process returns true then success else failed to register
If FSUIPC_Process(dwresult) = True Then
 '...success code
End If

Link to comment
Share on other sites

ReadOnly Property COM1() As Integer
            Return CInt(Hex(myCOM1))
        End Get
End Property

This is how I do it. I have a separate class which reads all the FS data I need on a regular cycle.

myCOM1 is a private vriable of type Int16 and I place the data I get via FSUIPC into myCOM1. This returns the com frequency * 1000 but without the starting 1.

for example if property COM1 returns 2346 then the actual com1 frequency is 123.46

Same works for COM2 and I presume the Nav frequencies altho I do not currently collect them

Hope this helps

Link to comment
Share on other sites

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.