KAPTEJNLN Posted September 6, 2010 Report Posted September 6, 2010 where do you have the Variable "L:AB_AP_SPDSTEP" from?As far as I know this variable does not exist...? Are you still able to set your SPD? yes i think so would try it. but it was pete there gave me the clue. here you se it for fast rotation speed LVarSPD = ipc.readLvar("L:AB_AP_SPDSTEP") LVarSet = "L:AB_AP_SPEED_Select" LVarGet = ipc.readLvar(LVarSet) if LVarSPD == 0 then ipc.writeLvar(LVarSet, LVarGet+10) end i could get it working as i changesd your file but crashed again so my small files seems to do the job ok. but try it out when i upload just have to eat now then fun could begine for others :-) ok pete would try the new later update here is the files: lau files Airbus X.zip
guenseli Posted September 6, 2010 Author Report Posted September 6, 2010 where do you have the Variable "L:AB_AP_SPDSTEP" from???? you have just talked about ALTSTEP which exists, but NOT SPDSTEP (as far as I know)
KAPTEJNLN Posted September 6, 2010 Report Posted September 6, 2010 where do you have the Variable "L:AB_AP_SPDSTEP" from????you have just talked about ALTSTEP which exists, but NOT SPDSTEP (as far as I know) Well it does els it would work right. i just tryeid edit by my self. but now the files is here
guenseli Posted September 6, 2010 Author Report Posted September 6, 2010 You haven't searched for LUA variables yourself? You haven't got the variables from Finn rom Aerosoft? LVarSPD = ipc.readLvar("L:AB_AP_SPDSTEP") LVarSet = "L:AB_AP_SPEED_Select" LVarGet = ipc.readLvar(LVarSet) if LVarSPD == 0 then ipc.writeLvar(LVarSet, LVarGet+10) end As SPDSTEP does not exist, the red lines are total useless! Of course, then the summary of LVarSPD = ipc.readLvar("L:AB_AP_SPDSTEP") is zero, thats why it is working... Beside this, your code is not different from my code, beside the fact, that you put it into separate files....
KAPTEJNLN Posted September 6, 2010 Report Posted September 6, 2010 You haven't searched for LUA variables yourself?You haven't got the variables from Finn rom Aerosoft? LVarSPD = ipc.readLvar("L:AB_AP_SPDSTEP") LVarSet = "L:AB_AP_SPEED_Select" LVarGet = ipc.readLvar(LVarSet) if LVarSPD == 0 then ipc.writeLvar(LVarSet, LVarGet+10) end As SPDSTEP does not exist, the red lines are total useless! Of course, then the summary of LVarSPD = ipc.readLvar("L:AB_AP_SPDSTEP") is zero, thats why it is working... Beside this, your code is not different from my code, beside the fact, that you put it into separate files.... all info i have is from you dokument and petes info and then my own modification of LVarSPD = ipc.readLvar("L:AB_AP_SPDSTEP") and no nothing is use less if you dont do that it crash thats simpel by the way not sure about if LVarSPD == 0 then could try delt it, but know the rest have to be that way nope if you delt "if LVarSPD == 0" it dosent work so it is as it should be
guenseli Posted September 6, 2010 Author Report Posted September 6, 2010 There is no "L:AB_AP_SPDSTEP"!!! I have just controlled it! So, your conclusion to solve your problems with inserting this lines is wrong. And your are simply lucky that your script is working!
KAPTEJNLN Posted September 6, 2010 Report Posted September 6, 2010 There is no "L:AB_AP_SPDSTEP"!!!I have just controlled it! So, your conclusion to solve your problems with inserting this lines is wrong. And your are simply lucky that your script is working! well did you try press the knop from in virtual cockpit just to test so it show speed then rotate the knob of the device. was it seup like my screen shot and by the way wasent you using vrinsight not goflight as they not work 100% same way but would talk to the betatester of it and let him try it out if he was using goflight. as it have nothing to do whit being lucky there are 2 options it works or not.
KAPTEJNLN Posted September 6, 2010 Report Posted September 6, 2010 have just tryeid it whith the new Update to 1.10a of the Airbus X and still working. now i would try my other system and see if that also work whit it. UPDATE also works on the other system whit another os instaled so seems to work for goflight users. so think i would upload to aerosoft after i have tryeid the new fsuipc update from you pete and thanks for your help mate. and make a new post you could ad for airbus X (goflight users). Best regards Lars N. UPDATE good job pete it worked by the way now im goeing to upload and then say there are 2 ways of geting it working update fsuipc or use my files. as my files runs smoother but think it is because it dosent have the delay as i tryeid only to update 1 of my systems to see the difference. so up to people what they like most :-) but good job and another thanks
KAPTEJNLN Posted September 6, 2010 Report Posted September 6, 2010 hey Pete, That i ment yesterday was if it wasent posible in some how to create an lau or some thing that gets the reading from the display in the vc of the plane and sendt it to the gf display as now whit the lau programing is abel to give input and seems to send data in to the lau file then it goes throue what you have programed and sendt info back. would it then be posible to sendt data to display whit out have to only use gf driver or fsuipc because you simply could exclude data to be sendt to gf display by the gf driver.
paulmidd Posted September 7, 2010 Report Posted September 7, 2010 well saidly both of the lau codes caused an faster not responding. here is the log That shows over 30 seconds of turning the knob -- how long do you sit there turning it for normally, then? Very strange. Regards Pete It can take that long, using this LUA script, to change heading perhaps through 135 degrees in 1 degree increments. That's what I was doing when my Airbus X and FSX also locked up. However, I have a personal solution because my Goflight RP48 has different 'button codes' for fast and slow rotations of the knobs. So I modified the LUA to capture fast rotations, and use 10 degree increments. Problem solved (or avoided). Much less knob twiddle time. Peter, would compiling the LUA also help in this situation? Regards PaulMidd
guenseli Posted September 7, 2010 Author Report Posted September 7, 2010 Hi Paul, thanks for your response. Seems we have a problem with bigger LUA files (like mine) and maybe slower systems? How fast is your PC? I have no problems at all with my VRInsight MCP Combi. My PC is a Q6600@3,4 Ghz with a 8800GTS Or we have maybe there a problem how GoFlight will handle or response to this LUA... I'm sure, Pete will jump in to advice us what the best solution is. The idea with the faster HDG is good. I have set it on the TO DO list for an update of my LUA file; I also will implement a faster SPD rotation! Please don't use KAPTEJNLNs LUA, because then we have no chance to fiddle out whats going on. He is using non existing LUA variables, but he wouldn't believe me :lol: btw I have had such behave with other addons using LUA in former times - month' ago. My system hasn't changed since, but there where several updates of FSUIPC. Means I know what you are talking about, but I don't know what solved the issue on my side...
Pete Dowson Posted September 7, 2010 Report Posted September 7, 2010 [Peter, would compiling the LUA also help in this situation? Yes, it could well do. Anything to speed it up. But have you tried with the latest FSUIPC updates, in which I've put a time limit on "killing" and "resurrecting" Luas files? I've now installed the AirbusX and tried with and without the timeout, using GoFlight RP48 dials (which act identically to the MCP ones), and I simply cannot make the repeats run fast enough to even try Killing the thread -- using Guenseli's long Lua, too. Admittedly I am using a fairly fast PC for this. However I am programming both fast and slow button numbers, both pressed and released, to maximise the rate, and yet there's still no problems. The logs shown earlier in the thread indicate enormous Lua run times, exceeding 60 mSecs in some cases, which is astonishing. The default timeout in the latest FSUIPC versions is 66 which should catch enough such long times to prevent a crash, but this can be increased if necessary. The alternative of separating all of the functions in the giant Lua into separate Lua's directly assigned to buttons rather than selected by parameter may also work well, depending really on what the cause of the delay is. Maybe it's more related to disk access than processor. Regards Pete
paulmidd Posted September 7, 2010 Report Posted September 7, 2010 Hi Paul,thanks for your response. Seems we have a problem with bigger LUA files (like mine) and maybe slower systems? How fast is your PC? Not particularly slow, although I'm due for my biennial upgrade next month. An E8600 @3.3, and a GTX 280. I'd be grateful for an update to your LUA, mine was a bit of a crude patch; two-speed speed would also be useful as you suggest. And I'll go for the latest FSUIPC as you suggest, Peter.
KAPTEJNLN Posted September 7, 2010 Report Posted September 7, 2010 Well pete about testet it on GoFlight RP48 dials whit guenseli file today i took the code from this site insted of aerosoft, and worked on my GoFlight RP48 but if using that whit goflight mcp it crash, testet today for 30 min ago.. by the way are you happy now guenseli updatet my file from yesterday to LVarSPD = ipc.readLvar("L:AB_AP_SPDMACH") as tested it yesterday where i also changesed it but crased it by that code, but it dosent make any difference as it worked whit my special code, as stil if i use your comand whit mcp it crash whit altitude hdg(fast not testet as it was that there caused it) but not SPD. but it worked but havet said it would keep running as not testet it much. !!UPDATE!! Just finished my test whit altitude problem and not even if i use another rotation button it helped. lau files Airbus X_v1.1.zip
Pete Dowson Posted September 7, 2010 Report Posted September 7, 2010 by the way are you happy now guenseli updatet my file Apart from the fact that I agree with Guenseli about the fact that reading an non-existent L:Var will always give 0 (and which can therefore be assumed), I cannot really comment, as no matter what I do I cannot produce any sort of problem at all. Also, of ocurse, Guenseli has a lot of experience accumulated with Lua and L:vars, and I'm sure you can place your trust in what he says. On another subject, I do wish you'd be more definitive about whether the changes I made in FSUIPC help at all. As one of very few folks reporting any problems at all I have to depend on you to at least report success or failure, and try various timeout values to see which works best. However, I've seen nothing from you apart from a brief mention that folks could "try my update"! Please also refrain from talking about "lau" files, as there is no such thing as "lau" supported by FSUIPC at all. The name of the language supported for plug-ins is Lua! Regards Pete
paulmidd Posted September 7, 2010 Report Posted September 7, 2010 I've tested your FSUIPC change, twiddling my SPD knob like mad for a minute or so. Absolutely fine. I know negative results aren't entirely satisfactory, but it does seem a case of 'no news is good news'. Regards PaulMidd
KAPTEJNLN Posted September 7, 2010 Report Posted September 7, 2010 well thank mate for testing and happy it also worked for you :-) now i am working on the display but have problems get started as need to know which display have which vaulve, and start whit out somethink to study isent easy, know the test panel but dosent seems to bee good to start as it works in a bit other way then you would do normaly. I know it already update gf display to the sim but only in hdg mode, and for altitude i cant remember as it sems to work in 1 of the modes after some time it stops then press again and it woul update display but 3 time it dosen do it anymore, or something like that, well alwasy you hit the engage button it up update only then. would be nice if could create an lau for gf display to update it. if posible
Pete Dowson Posted September 7, 2010 Report Posted September 7, 2010 now i am working on the display but have problems get started as need to know which display have which vaulve The displays are numbered in sequence, either left to right or right to left, I do not remember. But it should be easy to find out. You can't do any harm -- just write to each one till you find out. It won't explode or do anything else nasty! would be nice if could create an lau for gf display to update it. if posible There's no such thing as a "lau". Please try creating Lua files instead! Pete
Pete Dowson Posted September 7, 2010 Report Posted September 7, 2010 I've tested your FSUIPC change, twiddling my SPD knob like mad for a minute or so. Absolutely fine. Good. Thanks. Pete
KAPTEJNLN Posted September 7, 2010 Report Posted September 7, 2010 pete my main problem is how do i find out what to call the codes to tell which gofligh unit i would program and how to find info of what display and what to wride to set that display know. tryeid to see in the dokument but hard to just read and understand well mabee im just a bit stubid but i best learn from some exampels. so plz if you have any think i would be more then happy. because maybee i could tweek the files to push engage button constant but dosent think i would bee good. by the way wat did you mean, isent theu both lau files, i mean the one for gf display? would be nice if could create an lau for gf display to update it. if posible There's no such thing as a "lau". Please try creating Lua files instead! best regards Lars
Pete Dowson Posted September 7, 2010 Report Posted September 7, 2010 pete my main problem is how do i find out what to call the codes to tell which gofligh unit i would program and how to find info of what display and what to wride to set that display know. tryeid to see in the dokument but hard to just read and understand well mabee im just a bit stubid but i best learn from some exampels. so plz if you have any think i would be more then happy. Have you looked at the "gfd" Lua library? It is all very straight-forward. What is the problem? You must ask specific questions, not ask me to do all your work for you. I don't have time! Did you even bother to look at and try the "gfdDisplay.lua" example, provided with the examples installed with FSUIPC? Surely that shows you what to do? by the way wat did you mean, isent theu both lau files, i mean the one for gf display? I've no idea what you are talking about here, and there is no such thing as "lau" files, only Lua! Anyway, you are making this thread less than useful as a "stickie" for others to refer to. Please start a new thread if you want to continue. Pete
Pete Dowson Posted September 8, 2010 Report Posted September 8, 2010 Thanks to Guenseli for identifying the FADEC variables, I have a potentially useful solution to throttle assignments, especially those like PFC which cannot be assigned in FS. Note that this is all very much experimental at this stage. Feedback welcome. Try the following two Lua plug-ins: First this, saved as AirbusX_Thr1.lua: ipc.writeLvar("L:AS_FADEC_0", 4096 - (9 * ipcPARAM / 4)) And this, saved as AirbusX_Thr2.lua: ipc.writeLvar("L:AS_FADEC_1", 4096 - (9 * ipcPARAM / 4)) Save them in the FSX Modules folder. Then, in FSUIPC axis assignments, assign Throttle 1 to the so-called 'FS control' Lua AirbusX_Thr1, and similarly Throttle 2 to Lua AirbusX_Thr2. Note that you'll find these listed in the "Send to FS as normal axis" mode, NOT in the "Send direct to FSUIPC" mode. This is a quirk of how macros and plug-ins are recognised. For PFC users, as far as I can see you do NOT need to un-assign the axes in the normal way in PFCFSX.DLL. But I've not actually tried flying the AirbusX yetthe computer I've installed it on is not really suitably set up and i'd need some Airbus familiarisation time first in any case. Note that running a plug-in in this way gives no chance for normal calibration. The computation above: 4096 - (9 * input / 4) is designed to provide the apparently needed range of +40960 (idle) to -32768 (max). This passes through the assorted FADEC modes en route. However, that of course depends on the input value range being -16384 to +16383, which is only likely with a USB-connected digital device. My own PFC throttles only gave a range of -13030 to + 13545 in FSUIPC (allowing for a small dead zone either end -- never forget that), so I had to adjust the formula appropriately. The calculation is easy enough (I append it below), but an alternative to computing the formula is to fill in you minimum and maximum values in this more complex version of the Lua plug-in: mymax = 16380 --replace value with your throttle's max reading in FSUIPC, allowing for a small dead zone mymin = -16380 --replace value with your throttle's min reading in FSUIPC, allowing for a small dead zone mult = -73728 / (mymax - mymin) adj = 40960 - mult * mymin val = adj + (mult * ipcPARAM) ipc.writeLvar("L:AS_FADEC_0", val) That's for Throttle 1. Do the same for Throttle 2 but change "FADEC_0" to "FADEC_1". This longer plug-in is of course not as efficient as the nice short one, so it would really be best for you do actually do the computations and only put the resulting final formula in. So, the explanation: The reasoning behind the computation: Suppose the minimum input value (the negative one) is x and the maximum (the positive one) is y. First you need to compute the multiplier m such that m * (y - x) = (-32768) - 40960 = -73728. which is the FADEC range (it is negative because its max is -ve and min is +ve) So m = -73728 / (y - x) in my case this is m = -73728 / (13545 - (-13030)) = -73728/26575 = -2.774 Now if we multiply the input value by this 'm' we computed, we will get the desired range, but the values will be offset. So we must subtract our computed value from a number which places the values in the correctly offset range. Our 'idle' value is m * x, whereas the idle value we need is +40960, so we need to adjust by a = 40960 - (m * x). Using my own example again, m = -2.774 x = -13030 m * x = 36093 a = 40960 - 36093 = 4867 The final formula in the Lua plug-in you want is a + m * ipcPARAM which in my case comes to 4867 + (-2.77 * ipcPARAM) or more tidily 4867 - (2.77 * ipcPARAM) Feedback on all this please, from folks who know more about Airbus throttles and FADEC than I. If necessary I may build in more useful facilities into FSUIPC, but not without knowing exactly what works and what doesn't. Regards Pete
guenseli Posted September 8, 2010 Author Report Posted September 8, 2010 Pete (and all), I have updated my initial post, because I've finished my LUA for the throttle detends. That was done, before I recognized the above thread. Right now I will try your idea, Pete, and will report back....
Pete Dowson Posted September 8, 2010 Report Posted September 8, 2010 Right now I will try your idea, Pete, and will report back.... Okay. Thanks. The values I got seem to show a wider range than you found. I don't know why. I did try -32768 to +32768, which would obviously have been a lot easier, but using those extremes I couldn't get the throttles back to idle. Regards Pete
guenseli Posted September 9, 2010 Author Report Posted September 9, 2010 Hi Pete, The values I got seem to show a wider range than you found. I don't know why. I did try -32768 to +32768, -32768 is not working. I have had similar, but I don't remember what :oops: thats, why TOGA is in my LUA at just -32000 The LUA had a little trick inside :wink: took me one and a half hour to fiddle out... If you enter TOGA, the autothrust kicks automatically in. That means, first FADEC_0 reaches TOGA, TOGA kicks in and most of the time FADEC_1 didn't make it to 100% throttle, because it was stopped at present position. Thats why I have included ipc.control(65596) (full throttle). And this behave, that TOGA kicks in, is maybe why you can't get back to idle? regarding your throttle LUAs: I have installed it and the very first time there was a reaction. Engines spooled up a bit, but haven't look very concentrated at this time on them. I wanted to try it out then, but after this first little one there was no more reaction. I restarted FSX but I can't get any more reaction from the throttles... :?: EDIT: the log says there's a missing ")"? could it be, that the lines are ipc.writeLvar("L:AS_FADEC_0"), 4096 - (9 * ipcPARAM / 4)? The reaction at my first attempt mustn't be because of your LUA... it was just in the very first seconds after loading the flight when I moved the throttle. But maybe some other throttle was interferring there or whatever... below is the log of the last attempts I have assigned both LUAs to one throttle and also just one LUA to a throttle, no difference regards, Günter ********* LUA: "AirbusX_Thr1" Log [from FSUIPC version 4.626] ********* 457645 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) 457645 LUA: beginning "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua" 457645 *** LUA Error: ...6)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua:1: ')' expected near '' 457645 LUA: ended "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua" 457645 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) ********* LUA execution terminated: Log Closed ********* ********* LUA: "AirbusX_Thr1" Log [from FSUIPC version 4.626] ********* 457769 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) 457769 LUA: beginning "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua" 457769 *** LUA Error: ...6)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua:1: ')' expected near '' 457769 LUA: ended "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua" 457769 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) ********* LUA execution terminated: Log Closed ********* ********* LUA: "AirbusX_Thr1" Log [from FSUIPC version 4.626] ********* 457847 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) 457847 LUA: beginning "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua" 457847 *** LUA Error: ...6)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua:1: ')' expected near '' 457847 LUA: ended "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr1.lua" 457847 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) ********* LUA execution terminated: Log Closed ********* ********* LUA: "AirbusX_Thr2" Log [from FSUIPC version 4.626] ********* 457645 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) 457645 LUA: beginning "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua" 457645 *** LUA Error: ...6)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua:1: ')' expected near '' 457645 LUA: ended "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua" 457645 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) ********* LUA execution terminated: Log Closed ********* ********* LUA: "AirbusX_Thr2" Log [from FSUIPC version 4.626] ********* 457769 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) 457769 LUA: beginning "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua" 457769 *** LUA Error: ...6)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua:1: ')' expected near '' 457769 LUA: ended "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua" 457769 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) ********* LUA execution terminated: Log Closed ********* ********* LUA: "AirbusX_Thr2" Log [from FSUIPC version 4.626] ********* 457847 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) 457847 LUA: beginning "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua" 457847 *** LUA Error: ...6)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua:1: ')' expected near '' 457847 LUA: ended "F:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\AirbusX_Thr2.lua" 457847 System time = 09/09/2010 09:39:16, Simulator time = 09:33:44 (07:33Z) ********* LUA execution terminated: Log Closed *********
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now