
hawkt1
Members-
Posts
26 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by hawkt1
-
hello I'm using LUA to extra values from the aerosoft airbus. I've used writeUB as an example, obviously this limits the value to 255, then back to zero. What would be the right option? DD? Many thanks AB_AP_SPEED_Select_OFFSET = 0x66C3 AB_AP_HDG_Select_OFFSET = 0x66C4 function Autopilot_AP_SPEED_Select(varname, value) ipc.writeUB(AB_AP_SPEED_Select_OFFSET, value) end function Autopilot_AP_HDG_Select(varname, value) ipc.writeUB(AB_AP_HDG_Select_OFFSET, value) end
-
LUA Error: Aerosoft Airbus + FS Linda
hawkt1 replied to hawkt1's topic in FSUIPC Support Pete Dowson Modules
Removed Linda, removed the problem. Thanks for your help -
LUA Error: Aerosoft Airbus + FS Linda
hawkt1 replied to hawkt1's topic in FSUIPC Support Pete Dowson Modules
I will do Pete,Linda I have installed and when I created that script that was the error Linda was giving me. Really stupid question, I add an auto section to FSUIPC.ini with the name of the script right? It must be me doing something stupid -
LUA Error: Aerosoft Airbus + FS Linda
hawkt1 replied to hawkt1's topic in FSUIPC Support Pete Dowson Modules
Hi Pete, That is the entire script and its the latest I brought it a few days ago 4.949. In essence what I want too do is detect the autopilot state AB_AP_AP1 and write to 66C0 so I can then write and read from that offset. Best regards -
Hello Pete and team, My script is as below, and the error I get is below, what I don't understand is what have I missed? Syntax error! ...Steam\steamapps\common\FSX\Modules Line: 22: attempt to call field 'Lvar' (a nil value) stack traceback: ...Steam\steamapps\common\FSX\Modules\linda\lua\tmp.lua:22: in main chunk -- This function will be called when the lvars -- change. (See events below) function lvarChanged(varname, value) -- Check which lvar has changed if varname == "AB_AP_AP1" then -- Write the value (in this case 1 byte) -- into an offset ipc.writeUB(0x66C0, value) elseif varname == "AB_AP_AP2" then ipc.writeUB(0x66C1, value) end end -- Set up events to call the function above -- when the lvar changes. event.Lvar("AB_AP_AP1", 100, "lvarChanged")
-
Afternoon all I need to display my set value always as 5 figures, ie 200ft would show 00200 i tried the below, no joy Dim fsAPAltitudeValue As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H07D4) Dim APAltitudeValue Me.APAltitudeValue = fsAPAltitudeValue.Value * 3.28084 / 65536 Me.APAltitudeValue = Math.Round(APAltitudeValue, 0) TextBox1.Text = Me.APAltitudeValue.ToString("00000") Similar thing with the VS, negative VS gives a value or 65,000 Dim fsAPVSValue As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H07F2) Dim APVSValueMe.APVSValue = fsAPVSValue.Value
-
Thanks Paul for confirming that. I think the best thing to do would be to literally compare the current value against the old value and then call the relevant sub routine to action, something like Dim nav1 = 1 Dim nav1old = "" nav1old = nav1 if nav1 <> nav1old then 'do something endif
-
Hello Paul, FSUIPC related but more a question of vb, or more specifically the most productive way to achieve a result. At present I have a textbox.text changed event which then triggers another sub routine. However I want to get rid of the textboxes and detect when values change that I have pulled from fsuipc So for example detect the com value change and then trigger an event Dim nav1bcd As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H0350)Dim nav1String = ""nav1String = nav1bcd.Value.ToString("X4")I did think a timer to check the value might be the best way but im sure thats not the most resource easy way to do that.Need to monitor upto 40 different variables Any thoughts?
-
i'm just going to try that Paul, thank you. Your tireless effort to the community should be recognised. Whilst trying the above, question about the com frequencies. When its a whole number say 132.000, my textbox shows 132 I hoped to format it to show 132.000, same as i'd like 132.50 to shows 132.500, I thought a simple format like below would work but no joy, any thoughts? Me.com1DecStby = getFreqFromBCD(com1bcdstby.Value) Me.com1DecStby.ToString("##0.000")
-
Ah a Eureka Moment I amended this from <> to = 0 and voila I can tune 126.02 126.05 126.07 126.1 Brilliant! Thanks Paul as always so helpful If (freq * 1000) Mod 25 = 0 Then freq -= 0.005 End If For the ADF frequency (because you knew that was coming! :cool: ) I need to be able to extract the ADF frequency and then use buttons to increase each digit individually ie like a digital ADF and then send back. Any pointers for that?
-
Hmm ok, thats a pain, 126.03 wont tune 126.025 on vatsim for example, if I tune using the mouse I get 126.02 (126.025 when hovering over) - 126.05 - 126.07 (126.075 when hovering over) - 126.10
-
Thanks Paul, Bear with me, stupid question. By rounding say 126.025 and then encoding, were actually sending 126.03 to FSX? Dim com1bcdstby As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H311A) Dim com1DecStby As Decimal Me.com1DecStby = getFreqFromBCD(com1bcdstby.Value) com1DecStby += 0.025 com1bcdstby.Value = encodeFreqAsBCD(com1DecStby) Private Function encodeFreqAsBCD(freqDecimal As Decimal) As Short encodeFreqAsBCD = Short.Parse(((Decimal.Round(freqDecimal, 2, MidpointRounding.AwayFromZero) - 100) * 100).ToString("F0"), Globalization.NumberStyles.AllowHexSpecifier) End Function Private Function getFreqFromBCD(freqBCD As Short) As Decimal Dim freq As Decimal = ((Decimal.Parse(freqBCD.ToString("X")) / 100) + 100) TextBox1.Text = freq.ToString ' If the freqency is not a multiple of 0.025 then it's been rounded ' Subtract 5Khz to get real value If (freq * 1000) Mod 25 <> 0 Then freq -= 0.005 End If getFreqFromBCD = freq End Function
-
See too over complicating things!!! Doh Back to the frequency issue Paul This is my variable: Dim com1bcdstby As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H311A) This is my addition Me.com1maths.Text = com1bcdstby.Value.ToString("x") + 0.025 any my process to fsuipc com1bcdstby.Value = Short.Parse(com1maths.Text, Globalization.NumberStyles.AllowHexSpecifier) FSUIPCConnection.Process() Now it doesnt accept it because its a decimal number, can you point me in the right direction? BR
-
Thanks Paul, helpful as always So to change the two frequencies with a button? my two frequencies are Dim com2bcd As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H3118) Dim com2bcdstby As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H311C) Logically I created a value to hold com2bcd swapped com2bcd = com2bcdstby and combcdstby = value but then I cannot update it within the app
-
Perfect Paul, I thought I was over complicating this! I have a rotary encoder and arduino, works fine up and down but will exceed the limits ie 138 if I keep turning. Logic in VB would suggest something like if exceeds 136 then start at 118 etc. Or would you suggest a simpler alternative? Clearly I am overthinking it!
-
Hello all What is the increment for increasing the com frequency? I can increase the major number by adding 100 to the number but for the minor number it increments 2 then 3 then 2 then 3 Must be a simple calc? Any thoughts
-
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
will take you up on that offer Paul, cheers :mrgreen: -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
A random question but is it possible to tell which airfield an aircraft is at in the fs db via fsuipc as opposed to the lat and lon position? -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Spot on Paul, Thanks for that. Always makes me wonder why people bother using time acceleration. -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Hi Paul, Just a question, I've established using FSInterrogate what variable sets the sim rate and using FSI I have wrote to FS. Is it possible to write to FS / disable time acceleration by detecting a change in the number and setting it straight back to 1x. thanks -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Hi Paul, For example, I'd like to be able to store the fuel amount shown in the textbox upon starting the app, save that into another text field that isnt updated with the timer so I can view the fuel at start and fuel on landing if that makes sense (i'm working with the SDK example) -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Is it possible to store a value at startup, and place it into another textfield that is updated? -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Thanks Paul, I must have done something wrong the first time. I must admit to being a vbnet newbie and this forum has been amazing. :) -
FSUIPC Client DLL for .NET - Version 2.0
hawkt1 replied to Paul Henty's topic in FSUIPC Client DLL for .NET
Thanks guys for all your hard work. My projects coming along really nicely. I'm struggling to get any nav or com freq displaying correctly. Does anyone have a sample vbnet 2008 frequency code sample they wish to share? many thanks in advance. -
Hello people, Can anyone help with TCAS and VBNET, using the SDK and guides I'm unable to extract any information, can anyone help with this? many thanks