Jump to content
The simFlight Network Forums

fokker70

Members
  • Posts

    3
  • Joined

  • Last visited

About fokker70

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

fokker70's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Peter. I was thinking that each byte needed to be passed to FSUIPC_Write seperately, probably because the VB example show reading the time into an array: Dim auiTime() As Byte ReDim auiTime(3) If FSUIPC_Read(&H238, 3, VarPtr(auiTime(1)), dwResult) Then If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems lblClock.Caption = Format(auiTime(1), "00") & ":" & _ Format(auiTime(2), "00") & ":" & _ Format(auiTime(3), "00") Just a oversite on my part. I was making this more complicated that it needs to be. I used your suggestions and streamlined the code below and it works great (there is no error handling yet). Can you comment on if this is the proper way to use the SDK. Not the VB code, just the process of calling the Write function and them the Process function. Thanks Pete. Private Sub cmdLandingGearDown_Click() Dim gearDown As Integer gearDown = 16383 Call FSUIPC_Write(&HBE8, 4, VarPtr(gearDown), dwResult) Call FSUIPC_Process(dwResult) End Sub Private Sub cmdLandingGearUp_Click() Dim gearUp As Integer gearUp = 0 Call FSUIPC_Write(&HBE8, 4, VarPtr(gearUp), dwResult) Call FSUIPC_Process((dwResult)) End Sub
  2. I figured out why cmdLandingGearUp_Click function was not working. I was using FSUIPC_WriteS and not using the VarPtr function when passing the sencond parameter. Now I'm puzzled why the cmddLandingGearDown_Click function was working without these corrections! Oh well. The code below works: :D Private Sub cmdLandingGearDown_Click() Dim temp As Long Dim doGear(4) As Long doGear(1) = &HFF doGear(2) = &H3F doGear(3) = &H0 doGear(4) = &H0 Call FSUIPC_Write(&HBE8, 4, VarPtr(doGear(1)), dwResult) Call FSUIPC_Process(dwResult) End Sub Private Sub cmdLandingGearUp_Click() Dim temp As Long Dim doGear(4) As Long doGear(1) = &H0 doGear(2) = &H0 doGear(3) = &H0 doGear(4) = &H0 temp = FSUIPC_Write(&HBE8, 4, VarPtr(doGear(1)), dwResult) Call FSUIPC_Process((dwResult)) End Sub
  3. I'm a registered user of FSUIPC and WideFS. I'm taking my first crack at using Wide Client and writing a VB program to interface some hardware to FS2004. Wide Client connects to FS2004 with no problems. The VB program seemingly connects to Wide Client fine as I can read altitude and FS Time just fine. The problems I am having at the moment seem to be related to writing to FS2004. I have a few issues/questions... Thanks. 1) In the code below for Landing Gear Down works fine. The code for Landing Gear up does not bring the gear up. Does anyone see anthing wrong with the way I am doing this? 2) Im not certain I understand when to use FSUIPC_WriteS and when to use FSUIPC_Write. Private Sub cmdLandingGearDown_Click() Dim temp As Long Dim doGear(4) As Long doGear(1) = &HFF doGear(2) = &H3F doGear(3) = &H0 doGear(4) = &H0 temp = FSUIPC_WriteS(&HBE8, 4, doGear(1), dwResult) temp = FSUIPC_Process(dwResult) End Sub Private Sub cmdLandingGearUp_Click() Dim temp As Long Dim doGear(4) As Long doGear(1) = &H0 doGear(2) = &H0 doGear(3) = &H0 doGear(4) = &H0 temp = FSUIPC_WriteS(&HBE8, 4, doGear(1), dwResult) temp = FSUIPC_Process(dwResult) End Sub
×
×
  • 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.