Jump to content
The simFlight Network Forums

FSUIPC.net dll use with Module


Recommended Posts

Hello

At first, thank you for FSUIPC and the .net dll :)

I use Vb.net

I try to creat Functions in a Modul File to outsource the code.

this is my first function:


Public Sub connect()
Try
FSUIPCConnection.Open()
Catch ex As Exception
MsgBox("ERROR FSUIPC")
End Try
End Sub
[/CODE]

This function work very well.

But the next to read out the speed:

[CODE]
Public Sub mess()
Try
FSUIPCConnection.Process("")
Dim airSpeedKnots As Double = (airSpeed.Value / 128D)
' Label1.Text = airpeedKnots.ToString("f0")
trspeed = airSpeed.ToString("f0")
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
[/CODE]

doesen´t work

i call the Function in form1 with [b]test.mess[/b]but i get only the try-catch Error (msgbox"ERROR")

i imports [b]Imports FSUIPC [/b]in both files (The Modul-File and Form1)

Anyone can help me?

Link to comment
Share on other sites

Public Sub mess()
		Try
			FSUIPCConnection.Process("")
			Dim airSpeedKnots As Double = (airSpeed.Value / 128D)
			' Label1.Text = airpeedKnots.ToString("f0")
			trspeed = airSpeed.ToString("f0")
		Catch ex As Exception
			MsgBox("ERROR")
		End Try
	End Sub
[/CODE]

doesen´t work
i call the Function in form1 with [b]test.mess[/b]but i get only the try-catch Error (msgbox"ERROR")
Anyone can help me?

Hi Alex,
It will help more if you know what the exception (error) is that is being thrown.  MsgBox("Error") isn't very helpful.  Something like this would be better:
[code]
MsgBox("Error: " & ex.Message)

Anyway I think I see the problem:

			FSUIPCConnection.Process("")

If you don't want to process a particular group just use:

FSUIPCConnection.Process()

The error you are getting probably says that the group "" does not exist.

If that's not it then show me the message from the exception that's being thrown.

Paul

Link to comment
Share on other sites

How can i read out the Gear Settings

is this possible?

Of course. The positions of the landing gear are at offsets 0BEC, 0BF0 and 0BF4.

Information about these offsets and all other offsets are found in the documentation from the FSUIPC SDK. Either "FSUIPC4 Offsets Status.pdf" for FSX or "FSUIPC for Programmers.pdf" for FS9 and earlier.

Paul

Link to comment
Share on other sites

Public Gear As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&0BF0) ' gear

The hex specifier in VB is &H. So you need this:

Public Gear As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&HBF0) ' gear

Please take some time to review the UserGuide that comes with my DLL and the VB sample application. Everything is explained and shown in great detail.

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.