Jump to content
The simFlight Network Forums

How can I change time??


Recommended Posts

Hi,

I can't change FS time

my code...


   Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

     Dim zmin As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())("time", &H23C, 1)
     Dim zhour As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())("time", &H23B, 1)
     Dim second As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())("time", &H23A, 1)
     Dim hour As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())("time", &H238, 1)
     Dim min As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())("time", &H239, 1)


        FSUIPCConnection.Process("time")
        zhour.Value(0) = 10
        ' JST(+9)
        hour.Value(0) = 19
        zmin.Value(0) = 10
        min.Value(0) = 10
        second.Value(0) = 10
        FSUIPCConnection.Process("time")


    End Sub


Please give me sample....

Tinsukou

Link to comment
Share on other sites

Hello Tinsukou,

You don't need to use arrays here, just use 'Byte's. Also call the process() after assigning the values to the time offsets:

    Dim zmin As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23C)
    Dim zhour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23B)
    Dim second As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23A)
    Dim hour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H238)
    Dim min As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H239)

    Private Sub btnSetTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetLocalTime.Click

        ' set Local time to 20:33:05
        hour.Value = 20
        min.Value = 33
        second.Value = 5
        FSUIPCConnection.Process("time")

        ' OR set UTC (zulu) time to to 20:33:05
        'zhour.Value = 20
        'zmin.Value = 33
        'second.Value = 5
        'FSUIPCConnection.Process("time")

    End Sub

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.