Jump to content
The simFlight Network Forums

Graham Pollitt

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by Graham Pollitt

  1. Offset 6500 for the Position Lights switch appears to read a value of 1 regardless of switch position. It should read between 0 and 2. Checked via FSUIPC logging to FS window. EDIT Offset 6500 appears to be linked to Taxi Lights switch as well as 64FA
  2. Whats the attachment? 162 bytes for a screenshot? Not the correct file. Have you purchased a licence key?
  3. You will need to determine when the button is pushed in. In the code section for increasing/decreasing the heading you will need to check the button position. If it is set ie the button is pushed then increase/decrease heading by 5. If the button isn't pushed then increase/decrease by 1.
  4. Mr Guitar Here is the code I wrote for getting the current heading of the aircraft taken from my aircraft class module. You can see the calculations involved in getting this. 'heading' Private fsCurrentHeading As Offset(Of UInt32) = New FSUIPC.Offset(Of UInt32)("heading", &H580) Public CurrentHeading As UInt32 'magnetic variation' Private fsMagneticVariation As Offset(Of Short) = New FSUIPC.Offset(Of Short)("magneticvariation", &H2A0) 'this is the heading of the aircraft' Private MagneticVariation As Short 'gyrodrift' Private fsGyroDrift As Offset(Of Short) = New FSUIPC.Offset(Of Short)("gyrodrift", &HC3E) Private GyroDrift As Short Public Sub getCurrentHeading() 'return aircraft heading' FSUIPCConnection.Process("heading") FSUIPCConnection.Process("magneticvariation") FSUIPCConnection.Process("gyrodrift") Me.CurrentHeading = fsCurrentHeading.Value * 360D / (65536D * 65536D) MagneticVariation = fsMagneticVariation.Value * 360D / 65536D GyroDrift = fsGyroDrift.Value * 360D / 65536D Me.CurrentHeading = norm360((CurrentHeading + GyroDrift) - MagneticVariation) End Sub [/CODE] and this function I use is from John Dekker from another posting yonks ago [CODE] Function Norm360(ByVal h As Short) As Long 'this function returns correct heading within 360 degrees' If h > 360 Then Norm360 = h - 360 ElseIf h = 0 Then Norm360 = 0 'originally 360' ElseIf h < 0 Then Norm360 = h + 360 Else Norm360 = h End If Return Norm360 End Function [/CODE]
  5. Still using VB6? Crikey. You get another Crikey for resurrecting an 8yr old thread :razz:
  6. Offset 65D5 and 65D6. These contain values for what I assume are the Idle/Cutoff switches for fuel flow that are switched open during engine start. Both these offsets read 0 regardless of the switch state as read in FSInterrogate. Is the data for this being written correctly to the offsets via FSUIPC?
  7. I've seen mentioned on the forums that the 747 V2 and the 777 will have SDK but that nothing will be released for existing aircraft,
  8. I'll answer if I may - Read Only means just that. To change an offset value would mean that somewhere in an application it would have to re-read that offset to notice and act upon that change. Hence why Pete mentions in the manual - Follow that and any change in the relevent assignment you have made will be noticed within the 737NGX, updated within the 737NGX and then the appropriate value re-written to the appropriate offset for reading.
  9. I'd just like to say thanks for this as it saves me time having to learn Simconnect and C++ (I program in VB.net) The offset range in the line from the manual should be 661F. I put that range in FSInterrogate and didn't notice straight away the reason why it would only display one offset!Also for those that jump in without reading the SDK guide from PMDG don't forget to add the following (like I didn't earlier!) regards Graham
  10. Go here to ensure you have a valid licence as these are not the correct forums for your problem http://ifly.flight1.net/forums/default.asp
  11. I use config files for the aircraft as I need to read the maximum speed for that flap setting. That info isn't available within FS
  12. As aircraft have differing flap angles for each interval you will have to determine which flap angles to use for the current flap interval Here are snippets of code, not complete here just for example, in vb.net from my aircraft class for reading the flap angles (formatting doesnt look like it does in VStudio) I have a config file for each aircraft that I fly with flap data stored like this (taken from my 737-700 file) First number is raw value, 2nd is flap angle and 3rd is max airspeed for that flap extended //Flaps <NumberOfFlapAngles> 8 <FlapsData> 2048 1 250 4096 2 250 6144 5 250 8192 10 210 10239 15 200 12287 25 190 14335 30 175 16383 40 162 <EndFlapsData> <DefaultFlaps> 5 30 [/CODE] hence the following code copies the values read from the above section of the config file into the required arrays [CODE] 'read first line of flap data' line = parser.ReadFields() 'loop until end of flaps data section' While line(0) <> "<EndFlapsData>" objAircraft.FlapDetails(arrayindex) = line(0) objAircraft.FlapDetails(arrayindex + 1) = line(1) objAircraft.FlapDetails(arrayindex + 2) = line(2) 'read first line of flap data' line = parser.ReadFields() arrayindex += 3 End While [/CODE] The following code shows how to get the currently selected flap angle, max speed based on the raw value read from FS. This sub is called whenever I want to check for the flap values which I then do by reading the values stored within FlapAngleSet, FlapAngleMaximumSpeed [CODE] Public Sub getFlaps() Me.readFlapsOffset() Dim b As Short = 0 Dim c As Short = 1 'used as loop counter and also for flap array position so not zero based' Me.RawFlapsNumber = Me.fsRawFlapsNumber.Value While c <= Me.NumberOfFlapAngles 'only loop for the number of flaps ie 3' If Me.RawFlapsNumber = 0 Then 'if no flaps set then set angle to 0 for up and set max airspeed to max speed of aircraft' Me.FlapAngleSet = 0 Me.FlapAngleMaximumSpeed = Me.MaxStructuralAirspeed Me.FlapArrayPosition = 0 Exit While ElseIf Me.RawFlapsNumber = Me.FlapDetails(B) Then 'if raw value matches that for selected flap then get' 'the flap angle ie 20 and the max flap down speed for that angle' Me.FlapAngleSet = Me.FlapDetails(b + 1) Me.FlapAngleMaximumSpeed = Me.FlapDetails(b + 2) Me.FlapArrayPosition = c Exit While End If 'if not found then loop until read all the flap settings for that aircraft' 'ie 5 flaps settings, loop 5 times' b = b + 3 'move to next flap settings in array' c += 1 End While End Sub Public Sub readFlapsOffset() FSUIPCConnection.Process("flaps") End Sub [/CODE] These are only snippets from my aircraft class but should give you an idea of how to customise your ACARS app for flaps. This works fine for me.
  13. I'm interested if someone can make dll to interface with vb.net!
  14. Melvin, The following snippets are cut/pasted from parts of my aircraft class in Vb.Net for you to look at so it should be simple to convert to c# The norm360 function is possibly the part you should be interested in. Why are you reading offset 05D0 View Direction when you mention autopilot heading which is offset 7CC? Private fsAPHeadingValue As Offset(Of UShort) = New FSUIPC.Offset(Of UShort)("autopilot", &H7CC) Public APHeadingValue As Short 'autopilot' Public Sub getAutopilot() FSUIPCConnection.Process("autopilot") Me.APEnabled = Me.fsAPEnabled.Value Me.APAltitudeValue = fsAPAltitudeValue.Value * 3.28084 / 65536 Me.APHeadingValue = fsAPHeadingValue.Value * 360 / 65536 Me.APVSValue = fsAPVSValue.Value * 3.28084 / 65536 End Sub [/CODE] [CODE] Private fsCurrentHeading As Offset(Of UInt32) = New FSUIPC.Offset(Of UInt32)("heading", &H580) Public CurrentHeading As UInt32 'magnetic variation' Private fsMagneticVariation As Offset(Of Short) = New FSUIPC.Offset(Of Short)("magneticvariation", &H2A0) 'this is the heading of the aircraft' Private MagneticVariation As Short 'gyrodrift' Private fsGyroDrift As Offset(Of Short) = New FSUIPC.Offset(Of Short)("gyrodrift", &HC3E) Private GyroDrift As Short Public Sub getCurrentHeading() 'return aircraft heading' FSUIPCConnection.Process("heading") FSUIPCConnection.Process("magneticvariation") FSUIPCConnection.Process("gyrodrift") Me.CurrentHeading = fsCurrentHeading.Value * 360D / (65536D * 65536D) MagneticVariation = fsMagneticVariation.Value * 360D / 65536D GyroDrift = fsGyroDrift.Value * 360D / 65536D Me.CurrentHeading = norm360((CurrentHeading + GyroDrift) - MagneticVariation) End Sub Function Norm360(ByVal h As Short) As Long 'this function returns correct heading within 360 degrees' If h > 360 Then Norm360 = h - 360 ElseIf h = 0 Then Norm360 = 0 'originally 360' ElseIf h < 0 Then Norm360 = h + 360 Else Norm360 = h End If Return Norm360 End Function [/CODE]
  15. I've added .exe to my exclude list so it now works fine. Will update my virus signatures later and see if it doesnt give a false positive. Not updated for around 3 months. regards Graham
  16. I have a similar problem but ESET detects a virus in the zip. I can disable the virus checker to download the file but whenever the .exe is then started ESET quarantines it for me. How nice! Never had this prob before with Petes files. Maybe some new code in the .exe which is similar to a virus? (Win32 variant/Genetik trojan)
  17. I asked Nico a while ago to add some additional offsets for the Level-D 767 which he did. Recently I asked for him to add some more but he no longer maintains that utility. So I then coded my own utility for the controls/switches etc that I wanted to read from the Level-D 767. If you need to read controls/switches etc that are not in the FSConv utility then let me know. I can help you with that if required but it would involve you then using my utility and not FSConv. Or maybe you could use his LEKSeeCon !?! (or similar, can't remember offhand what it is called) regards Graham
  18. Hi, I know you asked specifically for VB6 but may I recommend that you download the VB.net express edition. Its free and you can get it from Microsoft website. I used to use VB5 and 6, not for FS programming, for college many years ago. Bit of a learning curve changing to .net as its object based but easy enough to grasp if you are an able programmer. Reason being is that you can then download and use Paul Hentys fabulous FSUIPC Client DLL as posted above which contains very clear examples of how to read/write data to/from FS. As both softwares are free you can try them and always delete if you don't like them! regards Graham
  19. Sorry. I use 'axis assignment'. No to apply general assignments but also get the same result if I click yes. Ok thanks Regards Graham
  20. Hi Pete, Just downloaded the 4.419 interim update and decided to use the new profile option for the controllers. I deleted my old cfg and a new cfg was created upon restarting FSX. The problem I have is this - Start a flight and go into the FSUIPC options Select 'Profile specific' option Click 'new' Enter 'Jet' as profile name and yes/no to genric assignments etc The 'profile specific' option is then automatically unchecked. - Is this correct? Re-selecting the 'profile specific' causes a repeat of the above yet when I then assign a control function ie elevator to a control device and try to calibrate it the calibration numbers don't change (FSUIPC selected for cal) Here is a section of the cfg where you can see the same 4 entries because of my re-selecting the 'profile specific' option. There are no controllers assigned at all to anything as though they haven't saved. [General] History=FOZ6HA9BUHC0F2H97YSDL MouseWheelTrim=No MouseWheelTrimSpeed=1 FixControlAccel=No FixMachSpeedBug=No VisibilityOptions=No OneCloudLayer=No CloudTurbulence=No CloudIcing=No GenerateCirrus=No SuppressCloudTurbulence=No MaxIce=-4 MinIce=-4 UpperWindGusts=No SuppressWindTurbulence=No SuppressWindVariance=No WindTurbulence=No TurbulenceRate=1.0,5.0 TurbulenceDivisor=20,20,40,40 SuppressAllGusts=No MaxSurfaceWind=0 WindLimitLevel=200 WindDiscardLevel=400 WindAjustAltitude=No WindAjustAltitudeBy=2000 WindSmoothing=No WindSmoothness=2 WindSmoothAirborneOnly=Yes PressureSmoothness=0 TemperatureSmoothness=0 DisconnTrimForAP=No ZeroElevForAPAlt=No ThrottleSyncAll=No WhiteMessages=No ShowPMcontrols=No SpoilerIncrement=512 MagicBattery=No RudderSpikeRemoval=No ElevatorSpikeRemoval=No AileronSpikeRemoval=No ReversedElevatorTrim=No ClockSync=No ClockSyncMins=5 ClearWeatherDynamics=No OwnWeatherChanges=No TimeForSelect=4 LoadFlightMenu=No LoadPlanMenu=No PauseAfterCrash=No SaveDataWithFlights=No ZapSound=firework ShortAircraftNameOk=No UseProfiles=Yes TCASid=Flight TCASrange=40 AxisCalibration=No DirectAxesToCalibs=No ShowMultilineWindow=Yes SuppressSingleline=No SuppressMultilineFS=No AxisIntercepts=No WeatherReadFactor=2 WeatherRewriteSeconds=1 CustomWeatherModify=No SimConnectStallTime=1 Console=No [JoyNames] AutoAssignLetters=No 0=CH PRO PEDALS USB 1=CH THROTTLE QUADRANT 2=CH FLIGHT SIM YOKE USB [LuaFiles] 1=display vals 2=liar [AutoSave] AutoSaveEnabled=No [GPSout] GPSoutEnabled=No Port= Speed=4800 Interval=1000 PosTo6Decimal=Yes Sentences= [WideServer] WideFSenabled=Yes AdvertiseService=1 Port=8002 Port2=9002 [ClientNames] 1=GRAY-LAPTOP [Profile.Jet] 1=Level D Simulations B767-300ER - Varig [DXT3] 2=Level D Simulations B767-300ER - Varig [DXT3] 3=Level D Simulations B767-300ER - Varig [DXT3] 4=Level D Simulations B767-300ER - Varig [DXT3] [JoystickCalibration] ExcludeThrottleSet=Yes ExcludeMixtureSet=Yes ExcludePropPitchSet=Yes SepRevsJetsOnly=No ApplyHeloTrim=No FlapsSetControl=0 FlapDetents=No ReverserControl=66292 Reverser1Control=66422 Reverser2Control=66425 Reverser3Control=66428 Reverser4Control=66431 MaxThrottleForReverser=256 AileronTrimControl=66731 RudderTrimControl=66732 CowlFlaps1Control=66162 CowlFlaps2Control=66163 CowlFlaps3Control=66164 CowlFlaps4Control=66165 SteeringTillerControl=0 MaxSteerSpeed=60 Aileron=-16380,-512,512,16380/8 Thanks Graham
  21. Sorry my name is Graham. Glad you've got it working, best regards
  22. Sorry, I edited my post as soon as I had sent it. Didnt think anyone would have read it that quickly so my answer is posted above! :D
  23. You are defining Public FSYear As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &H240) when it should be Public FSYear As Offset(Of UShort) = New FSUIPC.Offset(Of UShort)("fstime", &H240) You get the overflow error as you are loading a 16bit number into an 8bit variable Hope this helps!
  24. Download Paul Hentys' VB.net DLL posted above and read the user guide. You should be then be able to pretty much do what you want with regards to reading/writing to offsets within FS
  25. Using Paul Hentys VB.net DLL I have used the following code to write a small app called FSTimeStay for someone on a forum. It remembers the time within FS that the button is clicked and once a minute it writes that time back to FS. I am sure you can find some help within this code for what you are doing Imports FSUIPC Public Class Form1 Public hr, min, sec, hroffset As Short Public FSHour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &amp;H238) Public FSMin As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &amp;H239) Public FSSec As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("fstime", &amp;H23A) Public FSOffset As Offset(Of Short) = New FSUIPC.Offset(Of Short)("fstime", &amp;H246) Private Sub OpenFSUIPC() Try ' Attempt to open a connection to FSUIPC (running ON any version of Flight Sim) FSUIPCConnection.Open() Catch ex As Exception ' Badness occurred - show the error message MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Public Sub WriteTime() 'write the time back to fs FSHour.Value = Me.hr '+ Me.hroffset FSMin.Value = Me.min FSSec.Value = Me.sec FSUIPCConnection.Process("fstime") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Static Run As Boolean = False Static firstrun As Boolean = False If Run = False Then If firstrun = False Then Me.OpenFSUIPC() firstrun = True End If 'read current time FSUIPCConnection.Process("fstime") Me.hr = Me.FSHour.Value Me.min = Me.FSMin.Value Me.sec = Me.FSSec.Value Me.hroffset = Me.FSOffset.Value / 60 lblTime.Text = "Locked time : " &amp; Me.hr &amp; ":" &amp; Me.min &amp; ":" &amp; Me.sec &amp; " GMT Offset:" &amp; Me.hroffset 'start timer Me.Timer1.Enabled = True Me.Button1.Text = "Stop" Run = True Else Run = False Me.Timer1.Enabled = False Me.Button1.Text = "Activate" lblTime.Text = "Not running" End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'rewrite the time into FS dependant upon timer interval Me.WriteTime() End Sub End Class
×
×
  • 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.