Jump to content
The simFlight Network Forums

FSUIPC 7 MSFS2020 VB.net HELP


ihiyani

Recommended Posts

Tried to set tug heading and  speed controlled by integer by 


    Private TugH As New Offset(Of UInteger)(&H31F8)
    Private TugS As New Offset(Of UInteger)(&H31FC)
    Private TugState As New Offset(Of UInteger)(&H31F4)
 FSUIPCConnection.Process()
Dim HDG as integer = TextHDG.text
Dim SPD as integer = TextSPD.text
Dim Status as integer = TextSts.text

FSUIPCConnection.SendControlToFS(FsControl.KEY_TUG_HEADING, HDG)
FSUIPCConnection.SendControlToFS(FsControl.KEY_TUG_SPEED, SPD)

TugH.value= HDG
TugS.value= SPD
TugState.value= Status

So for the heading of the tug no one worked it just make the heading of aircraft is 357 degree whatever i change the heading in TextHDG , whatever integer i input just turn the tug to heads the aircraft to 357 .

for the speed it doesn't work 

for the status integer : 0 Pushback Straight 

1 to left 

2 to right 

3 stop pushback 

any helps plz ..  

Link to comment
Share on other sites

First, please make sure you're only declaring offsets once. Usually this is at the main class or form level.

All these offsets are write-only so they should be marked as write-only when you declare them. They should also be placed in their own group so you can process them separately.

The pushback seems to be different from the tug. The tug goes forward, not back.

    Private TugH As New Offset(Of UInteger)("tug", &H31F8, True)
    Private TugS As New Offset(Of UInteger)("tug", &H31FC, True)

    Private PushBackState As New Offset(Of UInteger)("pushback", &H31F4, True)

For offset 31F8, the heading in degrees needs to be converted to FSUIPC Units:

Dim HDG as integer = TextHDG.text * 360D / (65536D * 65536D)

For offset 31FC the values are in feet/second. 

The Process() call must come after you set the values so the new value can be written:

Dim HDG as UInteger = TextHDG.text
Dim SPD as UInteger = TextSPD.text
TugH.Value = HDG  * 360D / (65536D * 65536D)
TugS.Value = SPD
FSUIPCConnection.Process("tug")

Paul

 

Link to comment
Share on other sites

i tried it works for the Heading with no luck for the speed the plane doesn't move until i disconnect the tug what i want to do is to stop the pushing back while the tug still connected and re push back in button click whatever stopped or not the tug still connected so i try to make speed 0 while it connected ..

thanks Paul at all 

15 hours ago, Paul Henty said:

First, please make sure you're only declaring offsets once. Usually this is at the main class or form level.

All these offsets are write-only so they should be marked as write-only when you declare them. They should also be placed in their own group so you can process them separately.

The pushback seems to be different from the tug. The tug goes forward, not back.


    Private TugH As New Offset(Of UInteger)("tug", &H31F8, True)
    Private TugS As New Offset(Of UInteger)("tug", &H31FC, True)

    Private PushBackState As New Offset(Of UInteger)("pushback", &H31F4, True)

For offset 31F8, the heading in degrees needs to be converted to FSUIPC Units:


Dim HDG as integer = TextHDG.text * 360D / (65536D * 65536D)

For offset 31FC the values are in feet/second. 

The Process() call must come after you set the values so the new value can be written:


Dim HDG as UInteger = TextHDG.text
Dim SPD as UInteger = TextSPD.text
TugH.Value = HDG  * 360D / (65536D * 65536D)
TugS.Value = SPD
FSUIPCConnection.Process("tug")

Paul

 

 

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.