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

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.