
KAPTEJNLN
Members-
Posts
208 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by KAPTEJNLN
-
well isent it posible to use offsets like whit the lvars for increase or decrease speed, like i did for captainsim 757 whit lvars for the display where it ad 1 to the speed shown on the MCP in this case: LVarSet = "L:MCP_IAS_DSP" LVarGet = ipc.readLvar(LVarSet) + 1 end ipc.writeLvar(LVarSet, LVarGet) ---------------------------------------------------------------------------------------- it might be the same way it is set up but what should be used insted of LVarSet and LVarGet ? as far as i would think it woul be something like this but missing what there should be set infront of SET or GET: ????Set = "0x01f5" ----------------------- or should it be "01f5" ????Get = ipc.readUD(????Set) + 1 end ipc.writeLvar(????Set, ????Get)
-
well i had a look and i could also not use macro for this plane, but it isent required as if you set the standard comands from the list of FSX comands. you would se it turns on and of apu if you set start and stop apu or other settings from the dokument so just simply go in to fsx and open fsuipc and click buttons + switches then comand send when pressed and in the drop down menu type apu then there is the ones you could use. hope that helps.
-
well about: I hoped you'd be learning, but the more I explain the less you seem to know. well no thats not the case i just dident get it what you ment. as for the looping in those cases here it is basicly the same things, the same construction, it is more that i missed some pices as i dident know that you just simply could do: if (ALTCAP ~= prevALTCAP) or (ALTSEL ~= prevALTSEL) then as thats in some way what i was missing was a way to use OR in this case to say if this or this is the case it shuld light up. as basicly we used this all the time: prevALTCAP = 0 while 1 do ALTCAP = ipc.readLvar("L:CoamingAPALTSELCAP") --- here it reads the variable (lvar) and give it some kind of short name = ALTCAP if (ALTCAP ~= prevALTCAP) then -------------------------------------------------- here we test it. as if ALTCAP is different from prevALTCAP which could be 0 and if ALTCAP is 1 then led would turn on as it would then gfd.SetLight(GFMCPPRO,0,0) be different from 0 as it is now 1. else-------------------------------------else is used when both are 0 so there is no difference i think. gfd.ClearLight(GFMCPPRO,0,0) prevALTCAP = ALTCAP end so yes you have learned me the basic of the structure of the codes, i just think it is my confusing there is the problem for your understanding of what i am looking for or need.
-
yes i know That's how to test if "changed" in the Lua. but just get confused as if i just use if xxx then after each othere as far as i remember it would work. ALTSEL = ipc.readLvar("L:CoamingAPALTSEL") ALTCAP = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTCAP ~= prevALTCAP) then if (ALTSEL ~= prevALTSEL) then if ALTSEL changed or ALTCAP changed then if ALTSEL or ALTCAP then gfd.SetLight(GFMCPPRO,0,17) else gfd.ClearLight(GFMCPPRO,0,17) prevALTSEL = ALTSEL prevALTCAP = ALTCAP end as this would also not work. i realy try much more then i tell here, but it isent easy, whell when it works you say ofcause but when you have all the codes to puzzel whit it aint easy.
-
like this? ALTSEL = ipc.readLvar("L:CoamingAPALTSEL") ALTCAP = ipc.readLvar("L:CoamingAPALTSELCAP") if ALTSEL changed or ALTCAP changed then if ALTSEL or ALTCAP then gfd.SetLight(GFMCPPRO,0,17) else gfd.ClearLight(GFMCPPRO,0,17) end end but what about? if (ALTCAP ~= prevALTCAP) then if (ALTSEL ~= prevALTSEL) then
-
well i mean when ARM and CAP is on it should just light up steady, no flash at all. but whit the codes i showed you the led would flash. as it seems like when ARM light up in the plane it say 1 for on but when that goes off it turns to 0 whitch turns off that led again. and thats where the problem is becaus if i then does the same for the CAP 1 for turn on and 0 for off. ARM and CAP fight against each other as ARM want it to turn off when CAP is in use and Cap want to turn on the led. and the othere way. as i said, i might be able to turn on the led by seting the led when engage the ARM and turn it of whit a 0 clear light when CAP turns off but then it would reconise if the button ARM was turned off again. hope that explanes and sorry for my confusing pete.
-
the best result i got so fra was by combining the files like this snipit of the codes ALTSEL = ipc.readLvar("L:CoamingAPALTSEL") ALTCAP = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL ~= prevALTSEL) then gfd.SetLight(GFMCPPRO,0,17) end if (ALTSEL == prevALTSEL) then gfd.ClearLight(GFMCPPRO,0,17) end if (ALTCAP == prevALTCAP) then gfd.SetLight(GFMCPPRO,0,17) prevALTSEL = ALTSEL prevALTCAP = ALTCAP end you can see the led when in capture mode the led flash a little but not that much only visble that the light intensity goes litel up and down. so still cant find out how to do it as changes the prevXXX= 0 or 1 and edit the codes dident help. if they just have used the same lvar whit different numbers like 0 for oFF 1 for arm and mabe 2 for Cap. as 2 codes there need to be abel to turn off the same dosent seem that easy. Becaus how to... i cant see it as if i skip the cler for the 1 lvar and the set from the othere it works but if you dis engage before it gets to Capture mode nothing would happen to tthe led as no programing. so is there a way to chek the othere Lvar so it mabee could identify that way.
-
well whit the code the led flashes it was what i mean, and i know why it does it because the code say so. I just cant se how to get the ARM and CAP mode to work together for the same led. Inside the plane on the autopilot, you select a button can´t remember its name right now but when it is pressed it engage ARM (Armed mode) then you press IAS or VS mode as then you set the speed or vertical speed. then the plane would catch the selected IAS or VS until it gets near the altitude you have set. As when the plane gets near the selected altitude it switch from ARM to CAP (capture mode) on the autopilot. It is here i have a problem to just let the led light at both stages, because in the plane the ap button just light whit text ARM then CAP for the same button. there are more buttons that does the same but to keep it simple 1 step at a time. becaus if i just say sel would turn on the led and when cap is over it turns off the led. but then there is the problem what if you want to turn the mode off again then it dosent reach the Cap which turns-off the led. do you se the problem as then i need some thing when it is 1 it turns on led if 0 it turns off but that 0 would block when capture is in use right? it is here i keep thinking how to do so they work for the same led but dont block the othere which would result in the flashing effect.
-
ok i re done it prevCRS1 = -1 prevspeed = -1 prevhdg = -1 prevalt = -1 prevVS = -1 prevCRS2 = -1 prevALTCAP = 0 prevAPPRCAP = 0 prevBCCAP = 0 prevNAVCAP = 0 prevNAVHOLD = 0 prevAP = 0 prevYD = 0 prevBC = 0 prevBCCAP = 0 prevBANK = 0 prevSOFT = 0 prevSBYHOLD = 0 prevIASHOLD = 0 prevALTSEL = 0 prevHDGHOLD = 0 prevAPPRHOLD = 0 prevALTHOLD = 0 prevVSHOLD = 0 while 1 do CRS1 = ipc.readLvar("L:LeftCRS") if (CRS1 ~= prevCRS1) then stringCRS1 = string.format("%03d", CRS1) gfd.setDisplay(GFMCPPRO,0,0,stringCRS1) prevCRS1 = CRS1 end speed = ipc.readLvar("L:IASBug") if (speed ~= prevspeed) then stringspeed = string.format("%03d", speed) gfd.setDisplay(GFMCPPRO,0,1,stringspeed) prevspeed = speed end hdg = ipc.readLvar("L:HDGBug") if (hdg ~= prevhdg) then stringhdg = string.format("%03d", hdg) gfd.setDisplay(GFMCPPRO,0,2,stringhdg) prevhdg = hdg end alt = ipc.readLvar("L:AltSelAlt") if (alt ~= prevalt) then stringalt = string.format("%05d", alt) gfd.setDisplay(GFMCPPRO,0,3,stringalt) prevalt = alt end VS = ipc.readLvar("L:VSIASTarget") if (VS ~= prevVS) then stringalt = string.format("%05d", VS) gfd.setDisplay(GFMCPPRO,0,4,stringalt) prevVS = VS end CRS2 = ipc.readLvar("L:RightCRS") if (CRS2 ~= prevCRS2) then stringCRS2 = string.format("%03d", CRS2) gfd.setDisplay(GFMCPPRO,0,5,stringCRS2) prevCRS2 = CRS2 end ALTCAP = ipc.readLvar("L:CoamingAPALTSEL") if (ALTCAP ~= prevALTCAP) then gfd.SetLight(GFMCPPRO,0,17) else gfd.ClearLight(GFMCPPRO,0,17) prevALTCAP = ALTCAP end APPRCAP = ipc.readLvar("L:CoamingAPAPRCAP") if (APPRCAP ~= prevAPPRCAP) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) prevAPPRCAP = APPRCAP end BCCAP = ipc.readLvar("L:CoamingAPBCCAP") if (BCCAP ~= prevBCCAP) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) prevBCCAP = BCCAP end NAVCAP = ipc.readLvar("L:CoamingAPNAVCAP") if (NAVCAP ~= prevNAVCAP) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) prevNAVCAP = NAVCAP end NAVHOLD = ipc.readLvar("L:CoamingAPNAV") if (NAVHOLD ~= prevNAVHOLD) then gfd.SetLight(GFMCPPRO,0,1) else gfd.ClearLight(GFMCPPRO,0,1) prevNAVHOLD = NAVHOLD end AP = ipc.readUD(0x07BC) if (AP ~= prevAP) then gfd.SetLight(GFMCPPRO,0,2) else gfd.ClearLight(GFMCPPRO,0,2) prevAP = AP end YD = ipc.readUD(0x0808) if (YD ~= prevYD) then gfd.SetLight(GFMCPPRO,0,3) else gfd.ClearLight(GFMCPPRO,0,3) prevYD = YD end BC = ipc.readLvar("L:CoamingAPBC") if (BC ~= prevBC) then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) prevBC = BC end BCCAP = ipc.readLvar("L:CoamingAPBCCAP") if (BCCAP ~= prevBCCAP) then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) prevBCCAP = BCCAP end BANK = ipc.readLvar("L:APBankLimitSwitchSelect") if (BANK ~= prevBANK) then gfd.SetLight(GFMCPPRO,0,9) else gfd.ClearLight(GFMCPPRO,0,9) prevBANK = BANK end SOFT = ipc.readLvar("L:APSoftRideSwitchSelect") if (SOFT ~= prevSOFT) then gfd.SetLight(GFMCPPRO,0,10) else gfd.ClearLight(GFMCPPRO,0,10) prevSOFT = SOFT end SBYHOLD = ipc.readLvar("L:CoamingAPSBY") if (SBYHOLD ~= prevSBYHOLD) then gfd.SetLight(GFMCPPRO,0,15) else gfd.ClearLight(GFMCPPRO,0,15) prevSBYHOLD = SBYHOLD end IASHOLD = ipc.readLvar("L:CoamingAPIAS") if (IASHOLD ~= prevIASHOLD) then gfd.SetLight(GFMCPPRO,0,16) else gfd.ClearLight(GFMCPPRO,0,16) prevIASHOLD = IASHOLD end ALTSEL = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL ~= prevALTSEL) then gfd.SetLight(GFMCPPRO,0,17) else gfd.ClearLight(GFMCPPRO,0,17) prevALTSEL = ALTSEL end HDGHOLD = ipc.readLvar("L:CoamingAPHDG") if (HDGHOLD ~= prevHDGHOLD) then gfd.SetLight(GFMCPPRO,0,18) else gfd.ClearLight(GFMCPPRO,0,18) prevHDGHOLD = HDGHOLD end APPRHOLD = ipc.readLvar("L:CoamingAPAPR") if (APPRHOLD ~= prevAPPRHOLD) then gfd.SetLight(GFMCPPRO,0,19) else gfd.ClearLight(GFMCPPRO,0,19) prevAPPRHOLD = APPRHOLD end ALTHOLD = ipc.readLvar("L:CoamingAPALT") if (ALTHOLD ~= prevALTHOLD) then gfd.SetLight(GFMCPPRO,0,20) else gfd.ClearLight(GFMCPPRO,0,20) prevALTHOLD = ALTHOLD end VSHOLD = ipc.readLvar("L:CoamingAPVS") if (VSHOLD ~= prevVSHOLD) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) gfd.ClearLight(GFMCPPRO,0,23) prevVSHOLD = VSHOLD end ipc.sleep(50) end and had to face that i had to give ALTSEL and ALTCAP the same led insted of all 3 codes to 1 led as told earlyer (VS button) as those are required for othere things in the autopilot, so i had to include a seperate led for those 2. but still have the problem as it would flash. if i changes as you say to remove not nessecary setled and clear led it would work but if you then press the button again it would turn off corectly. as thos 2 codes works close togeter it only works whit the flashing effect so think i have to let it be so when that is engaged that button. as i dont know how to get it identify which is onn as it is led for the same button. but in the plane it is abel to show the text CAP and ARM. so thats why i need it to led id cap is engaged or ARM is engaged.
-
is i becaus of the placing of the ipc.sleep(50) it would changes them 20 times you are refering to so it shold be: ipc.sleep(50) after the displays then end and start whit the led for them self ? so it would look like this: prevCRS1 = -1 prevspeed = -1 prevhdg = -1 prevalt = -1 prevVS = -1 prevCRS2 = -1 while 1 do CRS1 = ipc.readLvar("L:LeftCRS") if (CRS1 ~= prevCRS1) then stringCRS1 = string.format("%03d", CRS1) gfd.setDisplay(GFMCPPRO,0,0,stringCRS1) prevCRS1 = CRS1 end speed = ipc.readLvar("L:IASBug") if (speed ~= prevspeed) then stringspeed = string.format("%03d", speed) gfd.setDisplay(GFMCPPRO,0,1,stringspeed) prevspeed = speed end hdg = ipc.readLvar("L:HDGBug") if (hdg ~= prevhdg) then stringhdg = string.format("%03d", hdg) gfd.setDisplay(GFMCPPRO,0,2,stringhdg) prevhdg = hdg end alt = ipc.readLvar("L:AltSelAlt") if (alt ~= prevalt) then stringalt = string.format("%05d", alt) gfd.setDisplay(GFMCPPRO,0,3,stringalt) prevalt = alt end VS = ipc.readLvar("L:VSIASTarget") if (VS ~= prevVS) then stringalt = string.format("%05d", VS) gfd.setDisplay(GFMCPPRO,0,4,stringalt) prevVS = VS end CRS2 = ipc.readLvar("L:RightCRS") if (CRS2 ~= prevCRS2) then stringCRS2 = string.format("%03d", CRS2) gfd.setDisplay(GFMCPPRO,0,5,stringCRS2) prevCRS2 = CRS2 end ipc.sleep(50) end ALTCAP = ipc.readLvar("L:CoamingAPALTSEL") if (ALTCAP == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end APPRCAP = ipc.readLvar("L:CoamingAPAPRCAP") if (APPRCAP == 1) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end BCCAP = ipc.readLvar("L:CoamingAPBCCAP") if (BCCAP == 1) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end NAVCAP = ipc.readLvar("L:CoamingAPNAVCAP") if (NAVCAP == 1) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end NAVHOLD = ipc.readLvar("L:CoamingAPNAV") if (NAVHOLD == 1) then gfd.SetLight(GFMCPPRO,0,1) else gfd.ClearLight(GFMCPPRO,0,1) end AP = ipc.readUD(0x07BC) if (AP == 1) then gfd.SetLight(GFMCPPRO,0,2) else gfd.ClearLight(GFMCPPRO,0,2) end YD = ipc.readUD(0x0808) if (YD == 1) then gfd.SetLight(GFMCPPRO,0,3) else gfd.ClearLight(GFMCPPRO,0,3) end BC = ipc.readLvar("L:CoamingAPBC") if (BC == 1) then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) end BCCAP = ipc.readLvar("L:CoamingAPBCCAP") if (BCCAP == 1) then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) end BANK = ipc.readLvar("L:APBankLimitSwitchSelect") if (BANK >= 1) then gfd.SetLight(GFMCPPRO,0,9) else gfd.ClearLight(GFMCPPRO,0,9) end SOFT = ipc.readLvar("L:APSoftRideSwitchSelect") if (SOFT >= 1) then gfd.SetLight(GFMCPPRO,0,10) else gfd.ClearLight(GFMCPPRO,0,10) end SBYHOLD = ipc.readLvar("L:CoamingAPSBY") if (SBYHOLD == 1) then gfd.SetLight(GFMCPPRO,0,15) else gfd.ClearLight(GFMCPPRO,0,15) end IASHOLD = ipc.readLvar("L:CoamingAPIAS") if (IASHOLD == 1) then gfd.SetLight(GFMCPPRO,0,16) else gfd.ClearLight(GFMCPPRO,0,16) end ALTSEL = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end HDGHOLD = ipc.readLvar("L:CoamingAPHDG") if (HDGHOLD == 1) then gfd.SetLight(GFMCPPRO,0,18) else gfd.ClearLight(GFMCPPRO,0,18) end APPRHOLD = ipc.readLvar("L:CoamingAPAPR") if (APPRHOLD == 1) then gfd.SetLight(GFMCPPRO,0,19) else gfd.ClearLight(GFMCPPRO,0,19) end ALTHOLD = ipc.readLvar("L:CoamingAPALT") if (ALTHOLD == 1) then gfd.SetLight(GFMCPPRO,0,20) else gfd.ClearLight(GFMCPPRO,0,20) end VSHOLD = ipc.readLvar("L:CoamingAPVS") if (VSHOLD == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) gfd.ClearLight(GFMCPPRO,0,23) end and how to use Timer event? and isent it good enoug when it looks for when active and inactive the way i do now ? bu i think a event is req as when i did as above the led dit not turn on anymore
-
well yes i use sleep it was a short version of it all here is the hole file: prevCRS1 = -1 prevspeed = -1 prevhdg = -1 prevalt = -1 prevVS = -1 prevCRS2 = -1 while 1 do CRS1 = ipc.readLvar("L:LeftCRS") if (CRS1 ~= prevCRS1) then stringCRS1 = string.format("%03d", CRS1) gfd.setDisplay(GFMCPPRO,0,0,stringCRS1) prevCRS1 = CRS1 end speed = ipc.readLvar("L:IASBug") if (speed ~= prevspeed) then stringspeed = string.format("%03d", speed) gfd.setDisplay(GFMCPPRO,0,1,stringspeed) prevspeed = speed end hdg = ipc.readLvar("L:HDGBug") if (hdg ~= prevhdg) then stringhdg = string.format("%03d", hdg) gfd.setDisplay(GFMCPPRO,0,2,stringhdg) prevhdg = hdg end alt = ipc.readLvar("L:AltSelAlt") if (alt ~= prevalt) then stringalt = string.format("%05d", alt) gfd.setDisplay(GFMCPPRO,0,3,stringalt) prevalt = alt end VS = ipc.readLvar("L:VSIASTarget") if (VS ~= prevVS) then stringalt = string.format("%05d", VS) gfd.setDisplay(GFMCPPRO,0,4,stringalt) prevVS = VS end CRS2 = ipc.readLvar("L:RightCRS") if (CRS2 ~= prevCRS2) then stringCRS2 = string.format("%03d", CRS2) gfd.setDisplay(GFMCPPRO,0,5,stringCRS2) prevCRS2 = CRS2 end ALTCAP = ipc.readLvar("L:CoamingAPALTSEL") if (ALTCAP == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end APPRCAP = ipc.readLvar("L:CoamingAPAPRCAP") if (APPRCAP == 1) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end BCCAP = ipc.readLvar("L:CoamingAPBCCAP") if (BCCAP == 1) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end NAVCAP = ipc.readLvar("L:CoamingAPNAVCAP") if (NAVCAP == 1) then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end NAVHOLD = ipc.readLvar("L:CoamingAPNAV") if (NAVHOLD == 1) then gfd.SetLight(GFMCPPRO,0,1) else gfd.ClearLight(GFMCPPRO,0,1) end AP = ipc.readUD(0x07BC) if (AP == 1) then gfd.SetLight(GFMCPPRO,0,2) else gfd.ClearLight(GFMCPPRO,0,2) end YD = ipc.readUD(0x0808) if (YD == 1) then gfd.SetLight(GFMCPPRO,0,3) else gfd.ClearLight(GFMCPPRO,0,3) end BC = ipc.readLvar("L:CoamingAPBC") if (BC == 1) then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) end BCCAP = ipc.readLvar("L:CoamingAPBCCAP") if (BCCAP == 1) then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) end BANK = ipc.readLvar("L:APBankLimitSwitchSelect") if (BANK >= 1) then gfd.SetLight(GFMCPPRO,0,9) else gfd.ClearLight(GFMCPPRO,0,9) end SOFT = ipc.readLvar("L:APSoftRideSwitchSelect") if (SOFT >= 1) then gfd.SetLight(GFMCPPRO,0,10) else gfd.ClearLight(GFMCPPRO,0,10) end SBYHOLD = ipc.readLvar("L:CoamingAPSBY") if (SBYHOLD == 1) then gfd.SetLight(GFMCPPRO,0,15) else gfd.ClearLight(GFMCPPRO,0,15) end IASHOLD = ipc.readLvar("L:CoamingAPIAS") if (IASHOLD == 1) then gfd.SetLight(GFMCPPRO,0,16) else gfd.ClearLight(GFMCPPRO,0,16) end ALTSEL = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end HDGHOLD = ipc.readLvar("L:CoamingAPHDG") if (HDGHOLD == 1) then gfd.SetLight(GFMCPPRO,0,18) else gfd.ClearLight(GFMCPPRO,0,18) end APPRHOLD = ipc.readLvar("L:CoamingAPAPR") if (APPRHOLD == 1) then gfd.SetLight(GFMCPPRO,0,19) else gfd.ClearLight(GFMCPPRO,0,19) end ALTHOLD = ipc.readLvar("L:CoamingAPALT") if (ALTHOLD == 1) then gfd.SetLight(GFMCPPRO,0,20) else gfd.ClearLight(GFMCPPRO,0,20) end VSHOLD = ipc.readLvar("L:CoamingAPVS") if (VSHOLD == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) gfd.ClearLight(GFMCPPRO,0,23) end ipc.sleep(50) end About: Really it is better to use events. With offset reads you can use event.offset to call functions when an offset changes. With L:Var reads you cannot do that, but you can have an event.timer, to call your L:Var checking routine at intervals, like 250 or 500 mSecs, for instance. yes but no offset for it only the Lvars asi can se in the log. And You should not be setting or clearing the lights on every loop, only when they need to change, yes but all 3 lvars have 1 and 0 to identify if active. so in reality do you mean that when L:CoamingAPVS is pressed it would be 1 as active delt the line for 0 as that cler the led then L:CoamingAPALTSEL is not required and when it come to its final step L:CoamingAPALTSELCAP then it reads the 0 and 1 is removed to as no need to set the light. was it ? to give a clear wiev of what happens when AP is running you press the VS speed button it would engage the alt sel button as i set it to the same button insted of an seperate button when it gets to around the selected altitude SELCAP takes over until the light is turned off and Alt led lights up to indicate that ALT is now active.
-
ALTCAP = ipc.readLvar("L:CoamingAPALTSEL") if (ALTCAP == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end VSHOLD = ipc.readLvar("L:CoamingAPVS") if (VSHOLD == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end ALTSEL = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end would it then be like the displayswhit prevXXXXX = -1 while 1 do ALTSEL = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end As i tryeid to run the codes that way but seems i need somthing that can identify. becaus if the codes just run as the were it is clear that they would flash as all 3 codes are set whit if thos is 1 then els then they all 3 wants to give input to the display as all 3 codes are giving info.
-
another thig isent i posible inside the ipcready file to get 3 variables work for the same led and how ? As i have tryeid some things but then the led just flashes. because i want it if posible to get the variabels to work for the same led as i can´t reflect whats happening in the plane. as it use 3 modes. so i would think combining all 3 would work best in this case for Vertical speed, so the led would light up when engaged, until it capture ALT and start anothere led which already work. just need those codes combined. ALTCAP = ipc.readLvar("L:CoamingAPALTSEL") if (ALTCAP == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end VSHOLD = ipc.readLvar("L:CoamingAPVS") if (VSHOLD == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end ALTSEL = ipc.readLvar("L:CoamingAPALTSELCAP") if (ALTSEL == 1) then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) end
-
yes i mean detect when the AP Master turns on OR off in this case. from the log: 47440 *** EVENT: Cntrl= 65792 (0x00010100), Param= 0 (0x00000000) AUTOPILOT_ON 48953 *** EVENT: Cntrl= 65791 (0x000100ff), Param= 0 (0x00000000) AUTOPILOT_OFF then like this: AP-OFF = ipc.readUD(the hexinumber) if AP-OFF == 0 then--------------------corect? gfd.SetLight(GFMCPPRO,0,2) ------------------------------------------------------------------------------------------------- update ok this works: AP = ipc.readUD(0x07BC) if (AP == 1) then gfd.SetLight(GFMCPPRO,0,2) else gfd.ClearLight(GFMCPPRO,0,2) end but how to get to that 0x07BC i try to read in the manual but dont get it. what number is it you calculate ? found that for the YAW damper it was: 0x0808 good file you made whit the offset variables,just woundering why it wasent in the folder whit the othere dokuments. i mean the FSUIPCOffsets.pdf but again thanks for your grate help
-
Hello pete, Now i have been working whit the J41 from pmdg. as i was preparing for the new 737ngx and wanted to get into codes by them. But i have a problem whit AP+YD engage / disengage. the rest of the lvars works. but think it is the way it was build as thos 2 buttons work close togeter. Is it possible to get the ipcready file read default comands like AUTOPILOT_OFF as i use macro for the buttons and in the fsuipc4.log by pressing the macro key command it shows when on and off and looks ok in the plane. becaus if it was posible to read it that way i could assigne the led. or can i use the codes from the list of controls for FSX and create some codes that way?
-
GF-MCP-PRO Captainsim 757 whit the latest version.
KAPTEJNLN replied to KAPTEJNLN's topic in User Contributions
!As a final Note! Be sure to have the latest version of FSUIPC and as note: i experinced after install of the captainsim 757 the latest version at first start up it wanted me to acept fsuipc 3.5 or as i remember so try remove fsuipc then and reinstall whit the latest version so FSX as you if it should run the latest and yes then it should work. 1 user said it dosent work i tested it and found that at start up it isent sure all is working but sure it alos would in the real plane. could have been if the plane wasent fully running, there for i made a file here you could try as the plane was fully running and the test file i have used to be sure the plane runs. here is the location you should place the file "Flight Simulator X Files" normaly found under dokuments. startup at CPH.zip -
!If you have previus version delt all files you got in previus version especialy the ipcready as thats replaced! ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- how to set it up (Note the displays would not work yet as thats first next step) ______________________________________________________________________________________________________________________________________________________________________________________________ When FSX is shutdown then go to the modules folder and open the fsuipc.ini file and search for ShortAircraftNameOk=NO then changes it to yes if you havent already did that before. then go down to the programing you jus made for the airbus might look like [buttons.Airbus A320] just longer whit the livery name rename it to the name shown: [buttons.Airbus A320] then copy from [buttons.Airbus A320] + all the lines to where it ends. then place it where the previus lines ends whit a space and paste it then rename it [buttons.Airbus A321] so you have 2 sections that contain the same info. as shown in the end ofthis post under the files from my ini file ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now go to the end of the dokument and insert this 1 space under the last line: [auto.Airbus A32] 1=LUA Airbus-X save the file and you are done just to show what i mean here is some of the importan info from my fsuipc.ini file: [Buttons.Airbus A320] 22=P157,2,CL16:R,0 23=P157,3,CL14:R,0 24=P149,22,CL16:R,0 25=P149,21,CL15:R,0 28=P149,29,CM15:6,0 29=P149,30,CM15:7,0 31=P149,17,CL12:R,0 34=P149,18,CL11:R,0 35=P149,19,CL9:R,0 36=P149,16,CL10:R,0 39=U149,19,CL9:R,0 40=U149,16,CL10:R,0 41=U157,2,CL16:R,0 42=P157,1,CL15:R,0 43=U157,1,CL15:R,0 44=P157,0,CL13:R,0 45=U157,0,CL13:R,0 46=U157,3,CL14:R,0 47=P157,14,CL11:R,0 48=P157,13,CL12:R,0 49=U157,13,CL12:R,0 50=U157,14,CL11:R,0 51=P157,15,CL9:R,0 52=U157,15,CL9:R,0 53=P157,12,CL10:R,0 54=U157,12,CL10:R,0 55=P157,10,CL7:R,0 56=U157,10,CL7:R,0 57=P157,9,CL6:R,0 58=U157,9,CL6:R,0 59=P157,11,CL5:R,0 60=U157,11,CL5:R,0 61=P157,8,CL4:R,0 62=U157,8,CL4:R,0 63=P158,2,CL17:R,0 64=P158,3,CL18:R,0 65=P158,4,CL19:R,0 66=U158,4,CL33:R,0 67=P158,14,CL36:R,0 68=U158,14,CL35:R,0 70=P158,16,CL30:R,0 71=P158,11,CL29:R,0 72=P158,19,CL23:R,0 73=P158,7,CL22:R,0 74=P158,18,CL26:R,0 76=P158,20,CL21:R,0 77=P158,21,CL32:R,0 78=P158,15,CL27:R,0 79=P158,12,CL25:R,0 80=U158,12,CL25:R,0 81=P158,13,CL20:R,0 82=P158,5,CL28:R,0 [Buttons.Airbus A321] 22=P157,2,CL16:R,0 23=P157,3,CL14:R,0 24=P149,22,CL16:R,0 25=P149,21,CL15:R,0 28=P149,29,CM15:6,0 29=P149,30,CM15:7,0 31=P149,17,CL12:R,0 34=P149,18,CL11:R,0 35=P149,19,CL9:R,0 36=P149,16,CL10:R,0 39=U149,19,CL9:R,0 40=U149,16,CL10:R,0 41=U157,2,CL16:R,0 42=P157,1,CL15:R,0 43=U157,1,CL15:R,0 44=P157,0,CL13:R,0 45=U157,0,CL13:R,0 46=U157,3,CL14:R,0 47=P157,14,CL11:R,0 48=P157,13,CL12:R,0 49=U157,13,CL12:R,0 50=U157,14,CL11:R,0 51=P157,15,CL9:R,0 52=U157,15,CL9:R,0 53=P157,12,CL10:R,0 54=U157,12,CL10:R,0 55=P157,10,CL7:R,0 56=U157,10,CL7:R,0 57=P157,9,CL6:R,0 58=U157,9,CL6:R,0 59=P157,11,CL5:R,0 60=U157,11,CL5:R,0 61=P157,8,CL4:R,0 62=U157,8,CL4:R,0 63=P158,2,CL17:R,0 64=P158,3,CL18:R,0 65=P158,4,CL19:R,0 66=U158,4,CL33:R,0 67=P158,14,CL36:R,0 68=U158,14,CL35:R,0 70=P158,16,CL30:R,0 71=P158,11,CL29:R,0 72=P158,19,CL23:R,0 73=P158,7,CL22:R,0 74=P158,18,CL26:R,0 76=P158,20,CL21:R,0 77=P158,21,CL32:R,0 78=P158,15,CL27:R,0 79=P158,12,CL25:R,0 80=U158,12,CL25:R,0 81=P158,13,CL20:R,0 82=P158,5,CL28:R,0 [auto.Captain Sim 757] 1=LUA C757 [auto.Airbus A32] 1=LUA Airbus-X Airbus X- mcp-pro Version1.0.zip
-
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
yes pete ofcause i think i Z z Z z Z It worked hdg = math.floor(0.5 + ipc.readLvar("AB_AP_HDG_Select_hist")) and yes when you say so i can se it is logic as take the variable and add 0.5 that would give if hdg 339,40+0.5 = 339,90 = 340. but also becaus you know what is posible to do in the lines. :smile: -
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
well back to the airbu as i wanted to update so it also have mach and that works but now it is the heading there shows 1 under. so would this work to on the heading HDG = math.floor(ipc.readLvar("AB_AP_HDG_Select") * 100) / 100 or is there another code for that. as i tryeid the code but it keeps showing hdg 1 degree under on the GOflight MCP. ? -
GF-MCP-PRO Captainsim 757 whit the latest version.
KAPTEJNLN replied to KAPTEJNLN's topic in User Contributions
Hello there, !Notice about previus version! so go down below the dashes if you like well this is the same version as the 1.00 this version only remove the ipcready file, because if you use Lua files for more than 1 plane this is a good option, so the file is loaded when you select the captainsim plane and when you load the airbus X as an ex you dont have to keep the files seperated changes every time you want to fly the other plane by overwriding. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ I have attached a cfg file for goflight driver if you run more that the mcp. if you dont just skip it and when fsx is running just shut down the gf driver as it isent required to run this way. Video of how to shut down gf driver: now jump down to below the next dashed line.If you should use goflight driver open the goflight setup program and save a file named 757 or something that indicate it is for that plane. then open my file and inster it to yours your saved file. find where the begining of the file i made is located [GFMCPPRO_1] then delt down to the next gf device. it also have a name that have the marks around the device text [xxxx_1] 1 stand for device 1 could be 2 if you have more of 1 device. (The goflight cfg i was refering to is located where you save the file from the goflight program. --- normaly dokuments/goflight) have a look on the picture where i edit the file. when done save your file. befor you colse the gf folder you have to right click on your file and say read only i mean it is on english system (the icon at the botum left corner, then apply and ok. as then you can load files for other planes and when you want to fly the 757 load that file and it would write any as we just prevent that. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- For the programing of the buttons set it as on the picture, note i havet wriden the rotations buttons as i think thats logic. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Now you have to open FSUIPC4.ini location is inside modules and open the dokument and look for ShortAircraftNameOk=NO and changes it to ShortAircraftNameOk=Yes then go down and at the end or so you should se a name: [buttons.Captain Sim 757-200] (the name is longer but edit it so it match this) if you then have the 757-300 also it is required to have a file for that to by doing this: copy the hole text from [buttons.Captain Sim 757-200] and to where it ends then place it right under whit a space then rename to [buttons.Captain Sim 757-300] so there is a text for both they include the same but is required to work right. now go to the end of the dokument and add this: [auto.Captain Sim 757] 1=LUA C757 Then save it. thats all when you select 1 of the planes it would load it and the displays should load + as you would se by doeing it this was the buttons works for all the planes now insted of only 1 as you edit that when you chansged the name to [buttons.Captain Sim 757]. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ok what to do if you have the files from the Airbus X just make a space and place it under and save. like this: [auto.Airbus A320] 1=LUA Airbus-X [auto.Captain Sim 757] 1=LUA C757 captainsim 757-V1.01 (whit out ipcready so you have to manualy edidt the INI file).zip -
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
ok thanks that wasen that hard:-) -
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
well thanks again for you help i found that using the files from yesterday works whit add the line: Mach = math.floor(ipc.readLvar("L:MCP_MACH_DSP") * 100) / 100 and by using the L:MCP_IAS_M_FLG as the sel button which is in the log, at startup L:MCP_IAS_M_FLG = 0 then i took that and try say as the push button ("L:MCP_IAS_M_FLG", 1) which works and would be the same as L:MCP_IAS_M_FLG = 1 but could find it in the log. only L:MCP_IAS_M_FLG = 0 + when i watch the button inside the plane the SEL button moves in when pressed for mach and comes back out when pressed again. also if i write("L:MCP_IAS_M_FLG", 2) nothing happens so it must be good enoug. about running more lua files for diferent planes then the ipcready should just contain: ipc.runlua("C757.lua") to run the file that is renamed from ipcready to C757.lua right? but how to insert a file for another plane like the airbus X. as this would work: ipc.runlua("C757.lua") ipc.runlua("A320.lua") seems like i miss something that can identyfy which plane is in use right? -
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
yes that seems to work when you press the button inside the plane. but have to think the things thru about the L:MachIASSelect as when it is in use in the ipcready it identify so it switch when you press the button but when i want to use it as push button it dosent do any thing. then i think we need to do as said yesterday write direct to the GF display insted, as it seems like you said it is not sure we can use all the Lvars, if other processes is made some where els. -
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
well the codes i made and show here yesterday worked why i asked was because when i switch between the mach and ias (the mach number some times show the mach number from the plane + 0.01 mach more than inside the plane (if plane shows 0.50 mach it some times shows as ex 0.51 on the goflight device. it dosent happen all the time as it shows it right sometimes) so i was thinkig if it was becaus i made an error. but whit the code you mad it does the same so now i have to spot why it somtimes gives different inputs, and to test if it was my button for SEL i tryeid to changes the by pressing the button inside the plane insted but by doeing that it does the same somtimes the shown mach number + 0.01 on the goflight device. So another thanks for you grate help pete -
Goflight MCP Displays (Lua file)
KAPTEJNLN replied to KAPTEJNLN's topic in FSUIPC Support Pete Dowson Modules
was it corect above or did you mean like for the displays where prevDES = -1 while 1 do DES = ipc.readLvar("L:MachIASSelect") (DES ~= prevDES) LVarSet = "L:MCP_MACH_DSP" LVarGet = ipc.readLvar(LVarSet) - 0.05 else LVarSet = "L:MCP_IAS_DSP" LVarGet = ipc.readLvar(LVarSet) - 10 end prevDES = DES ipc.writeLvar(LVarSet, LVarGet) ---------------------------------------------------------------------------- well isent there a way inside the ipcready.lua to identify which display is in use by reading L:MachIASSelect is that the same way as the mach / ias sel button? prevCRS1 = -1 prevalt = -1 prevhdg = -1 prevspeed = -1 prevMach = -1 prevCRS2 = -1 prevVS = -1 prevVNAV = -1 prevLNAV = -1 prevAP1 = -1 prevAP2 = -1 prevAP3 = -1 prevTHR = -1 prevLOC = -1 prevFD = -1 prevN1 = -1 prevSPDN = -1 prevFLCH = -1 prevHDGN = -1 prevAPPR = -1 prevALTN = -1 prevVS = -1 while 1 do CRS1 = ipc.readLvar("L:VOR1_OBS") if (CRS1 ~= prevCRS1) then stringCRS1 = string.format("%03d", CRS1) gfd.setDisplay(GFMCPPRO,0,0,stringCRS1) prevCRS1 = CRS1 end ipc.sleep(50) alt = ipc.readLvar("L:MCP_ALT_DSP") if (alt ~= prevalt) then stringalt = string.format("%05d", alt) gfd.setDisplay(GFMCPPRO,0,3,stringalt) prevalt = alt end ipc.sleep(50) VS = ipc.readLvar("L:MCP_VS_DSP") if (VS ~= prevVS) then stringalt = string.format("%05d", VS) gfd.setDisplay(GFMCPPRO,0,4,stringalt) prevVS = VS end ipc.sleep(50) hdg = ipc.readLvar("L:MCP_HDG_DSP") if (hdg ~= prevhdg) then stringhdg = string.format("%03d", hdg) gfd.setDisplay(GFMCPPRO,0,2,stringhdg) prevhdg = hdg end ipc.sleep(50) speed = ipc.readLvar("L:MCP_IAS_DSP") if (speed ~= prevspeed) then stringspeed = string.format("%03d", speed) gfd.setDisplay(GFMCPPRO,0,1,stringspeed) prevspeed = speed end ipc.sleep(50) Mach = ipc.readLvar("L:MCP_MACH_DSP") if (Mach ~= prevMach) then stringMach = string.format("%01.2f", Mach) gfd.setDisplay(GFMCPPRO,0,1,stringMach) prevMach = Mach end ipc.sleep(50) CRS2 = ipc.readLvar("L:VOR2_OBS") if (CRS2 ~= prevCRS2) then stringCRS2 = string.format("%03d", CRS2) gfd.setDisplay(GFMCPPRO,0,5,stringCRS2) prevCRS2 = CRS2 end ipc.sleep(50) VNAV = ipc.readLvar("L:MCP_VNAV_LT") if (VNAV ~= prevVNAV ) then if VNAV == 1 then gfd.SetLight(GFMCPPRO,0,0) else gfd.ClearLight(GFMCPPRO,0,0) end prevVNAV = VNAV end LNAV = ipc.readLvar("L:MCP_LNAV_LT") if (LNAV ~= prevLNAV ) then if LNAV == 1 then gfd.SetLight(GFMCPPRO,0,1) else gfd.ClearLight(GFMCPPRO,0,1) end prevLNAV = LNAV end AP1 = ipc.readLvar("L:MCP_CMD_L_LT") if (AP1 ~= prevAP1) then if AP1 == 1 then gfd.SetLight(GFMCPPRO,0,2) else gfd.ClearLight(GFMCPPRO,0,2) end prevAP1 = AP1 end AP2 = ipc.readLvar("L:MCP_CMD_R_LT") if (AP2 ~= prevAP2) then if AP2 == 1 then gfd.SetLight(GFMCPPRO,0,3) else gfd.ClearLight(GFMCPPRO,0,3) end prevAP2 = AP2 end AP3 = ipc.readLvar("L:MCP_CMD_C_LT") if (AP3 ~= prevAP3) then if AP3 == 1 then gfd.SetLight(GFMCPPRO,0,9) else gfd.ClearLight(GFMCPPRO,0,9) end prevAP3 = AP3 end THR = ipc.readLvar("L:MCP_AT_SW") if (THR ~= prevTHR) then if THR == 1 then gfd.SetLight(GFMCPPRO,0,100) else gfd.ClearLight(GFMCPPRO,0,100) end prevTHR = ATHR end LOC = ipc.readLvar("L:MCP_LOC_LT") if (LOC ~= prevLOC) then if LOC == 1 then gfd.SetLight(GFMCPPRO,0,7) else gfd.ClearLight(GFMCPPRO,0,7) end prevLOC = LOC end FD = ipc.readLvar("L:MCP_FD_switch") if (FD ~= prevFD) then if FD == 1 then gfd.SetLight(GFMCPPRO,0,14) gfd.SetLight(GFMCPPRO,0,23) else gfd.ClearLight(GFMCPPRO,0,14) gfd.ClearLight(GFMCPPRO,0,23) end prevFD = FD end N1 = ipc.readLvar("L:MCP_EPR_LT") if (N1 ~= prevN1) then if N1 == 1 then gfd.SetLight(GFMCPPRO,0,15) else gfd.ClearLight(GFMCPPRO,0,15) end prevN1 = N1 end SPDN = ipc.readLvar("L:MCP_SPD_LT") if (SPDN ~= prevSPDN) then if SPDN == 1 then gfd.SetLight(GFMCPPRO,0,16) else gfd.ClearLight(GFMCPPRO,0,16) end prevSPDN = SPDN end FLCH = ipc.readLvar("L:MCP_FLCH_LT") if (FLCH ~= prevFLCH) then if FLCH == 1 then gfd.SetLight(GFMCPPRO,0,17) else gfd.ClearLight(GFMCPPRO,0,17) end prevFLCH = FLCH end HDGN = ipc.readLvar("L:MCP_HDG_HOLD_LT") if (HDGN ~= prevHDGN) then if HDGN == 1 then gfd.SetLight(GFMCPPRO,0,18) else gfd.ClearLight(GFMCPPRO,0,18) end prevHDGN = HDGN end APPR = ipc.readLvar("L:MCP_APP_LT") if (APPR ~= prevAPPR) then if APPR == 1 then gfd.SetLight(GFMCPPRO,0,19) else gfd.ClearLight(GFMCPPRO,0,19) end prevAPPR = APPR end ALTN = ipc.readLvar("L:MCP_ALT_HOLD_LT") if (ALTN ~= prevALTN) then if ALTN == 1 then gfd.SetLight(GFMCPPRO,0,20) else gfd.ClearLight(GFMCPPRO,0,20) end prevALTN = ALTN end VS = ipc.readLvar("L:MCP_VS_LT") if (VS ~= prevVS) then if VS == 1 then gfd.SetLight(GFMCPPRO,0,21) else gfd.ClearLight(GFMCPPRO,0,21) gfd.ClearLight(GFMCPPRO,0,10) end prevVS = VS end ipc.sleep(50) end