November 25, 200916 yr Inspired by the excellent work of Guenter Steiner I have written another Lua file. See Guenter's post here for instructions on how to use this. (Of course it only works with a registered copy of FSUIPC)Guenter's Lua TopicYou need to call this something different to Guenter's file. I called mine J41_Add.lua. It should give you the following commands:1 Left Fuel Pump2 Right Fuel Pump3 Ground Power4 Warning Panel mute5 Left Air Cabin Flow*6 Right Air Cabin Flow*7 Start Master Knob Left8 Start Master Knob Right9 Nav Lights10 Nav/Tail Flood lights11Seat Belt Signs12 No Smoking Signs13 Left Windshield Anti Ice14 Right Windshield Anti Ice15 Left Air Data Anti Ice16 Right Air Data Anti Ice17 DC Power Knob up18 DC Power knob down*I programmed the cabin air switches so they only work if they are set to 5 or off so they toggle between these two values. Here is the lua file -- LEFT Fuel Pump SWITCH TOGGLEif ipcPARAM == 1 then LFuel = ipc.readLvar("L:LeftStbyFuelPump")if LFuel == 1 thenipc.writeLvar("L:LeftStbyFuelPump", 0)ipc.control(66587, 8027)elseif LFuel == 0 thenipc.writeLvar("L:LeftStbyFuelPump", 1)ipc.control(66587, 8028)end-- RIGHT Fuel Pump SWITCH TOGGLEelseif ipcPARAM == 2 thenRFuel = ipc.readLvar("L:RightStbyFuelPump")if RFuel == 1 thenipc.writeLvar("L:RightStbyFuelPump",0)ipc.control(66587, 8027)elseif RFuel == 0 thenipc.writeLvar("L:RightStbyFuelPump", 1)ipc.control(66587, 8028)end-- GROUND POWER SWITCH TOGGLEelseif ipcPARAM == 3 thenGPwr = ipc.readLvar("L:GndPowerSwitch")if GPwr == 1 thenipc.writeLvar("L:GndPowerSwitch", 0)ipc.control(66587, 8028)elseif GPwr == 0 thenipc.writeLvar("L:GndPowerSwitch", 1)ipc.control(66587, 8027)end-- Warning Panel Mute SWITCH TOGGLEelseif ipcPARAM == 4 thenWarnMute = ipc.readLvar("L:CapMuted")if WarnMute == 1 thenipc.writeLvar("L:CapMuted", 0)ipc.control(66587, 8027)ipc.writeLvar("L:CapMuteSwitch", 0)ipc.control(66587, 8027)elseif WarnMute == 0 thenipc.writeLvar("L:CapMuted", 1)ipc.writeLvar("L:CapMuteSwitch", 1)ipc.control(66587, 8027)end-- LEFT CABIN FLOW SWITCH TOGGLEelseif ipcPARAM == 5 thenLCabFlw = ipc.readLvar("L:CabinFlowControl")if LCabFlw== 6 thenipc.writeLvar("L:CabinFlowControl", 0)ipc.control(66587, 8027)elseif LCabFlw == 0 thenipc.writeLvar("L:CabinFlowControl", 6)ipc.control(66587, 8027)end-- RIGHT CABIN FLOW SWITCH TOGGLEelseif ipcPARAM == 6 thenRCabFlw = ipc.readLvar("L:FDeckFlowControl")if RCabFlw== 6 thenipc.writeLvar("L:FDeckFlowControl", 0)ipc.control(66587, 8027)elseif RCabFlw == 0 thenipc.writeLvar("L:FDeckFlowControl", 6)ipc.control(66587, 8027)end-- START MASTER KNOB LEFT GROUNDelseif ipcPARAM == 7 thenLStart = ipc.readLvar("L:StartMasterKnob")if LStart > 0 thenipc.writeLvar("L:StartMasterKnob",0)ipc.control(66587, 8028)elseif LStart == 0 thenend-- START MASTER KNOB RIGHT GROUNDelseif ipcPARAM == 8 thenLStart = ipc.readLvar("L:StartMasterKnob")if LStart < 2 thenipc.writeLvar("L:StartMasterKnob",2)ipc.control(66587, 8028)elseif LStart == 2 thenend-- NAV LIGHTS TOGGLEelseif ipcPARAM == 9 thenNavLt = ipc.readLvar("L:NavLightSwitch")if NavLt < 2 thenipc.writeLvar("L:NavLightSwitch", 2)ipc.control(66587, 8027)elseif NavLt == 2 thenipc.writeLvar("L:NavLightSwitch", 1)ipc.control(66587, 8028)end-- NAV LIGHTS/TAIL FLOODS TOGGLEelseif ipcPARAM == 10 thenNavLt = ipc.readLvar("L:NavLightSwitch")if NavLt > 0 thenipc.writeLvar("L:NavLightSwitch", 0)ipc.control(66587, 8027)elseif NavLt == 0 thenipc.writeLvar("L:NavLightSwitch", 1)ipc.control(66587, 8028)end-- SEAT BELT switch TOGGLEelseif ipcPARAM == 11 thensblt = ipc.readLvar("L:FastenSeatbeltSigns")if sblt == 1 thenipc.writeLvar("L:FastenSeatbeltSigns", 0)ipc.control(66587, 8028)ipc.control(66587, 74)elseif sblt == 0 thenipc.writeLvar("L:FastenSeatbeltSigns", 1)ipc.control(66587, 8027)ipc.control(66587, 74)end-- NO SMOKING SWITCH TOGGLEelseif ipcPARAM == 12 thennsmk = ipc.readLvar("L:NoSmokingSigns")if nsmk == 1 thenipc.writeLvar("L:NoSmokingSigns", 0)ipc.control(66587, 8028)ipc.control(66587, 74)elseif nsmk == 0 thenipc.writeLvar("L:NoSmokingSigns", 1)ipc.control(66587, 8027)ipc.control(66587, 74)end-- Left Windshield Antiice offelseif ipcPARAM == 13 thenLWS = ipc.readLvar("L:LeftWSAntice")if LWS == 2 thenipc.writeLvar("L:LeftWSAntice",1)ipc.control(66587,8027)elseif LWS == 1 thenipc.writeLvar("L:LeftWSAntice", 2)ipc.control(66587,8028)end-- Right Windshield Antiice offelseif ipcPARAM == 14 thenRWS = ipc.readLvar("L:RightWSAntice")if RWS == 1 thenipc.writeLvar("L:RightWSAntice",0)ipc.control(66587,8027)elseif RWS == 0 thenipc.writeLvar("L:RightWSAntice", 1)ipc.control(66587,8028)end-- Left Air Data offelseif ipcPARAM == 15 thenLAD = ipc.readLvar("L:LeftAirData")if LAD == 1 thenipc.writeLvar("L:LeftAirData",0)ipc.control(66587,8027)elseif LAD == 0 thenipc.writeLvar("L:LeftAirData", 1)ipc.control(66587,8028)end-- Right Air Data offelseif ipcPARAM == 16 thenRAD = ipc.readLvar("L:RightAirData")if RAD == 1 thenipc.writeLvar("L:RightAirData",0)ipc.control(66587,8027)elseif RAD == 0 thenipc.writeLvar("L:RightAirData", 1)ipc.control(66587,8028)end-- DC PowersourceKnob UPelseif ipcPARAM == 17 thenDCP = ipc.readLvar("L:DCPowerSourceKnob")if DCP < 3 thenipc.writeLvar("L:DCPowerSourceKnob", DCP+1)ipc.control(66587, 8039)elseif DCP == 3 thenend-- DC PowersourceKnob DOWNelseif ipcPARAM == 18 thenDCP = ipc.readLvar("L:DCPowerSourceKnob")if DCP > 0 thenipc.writeLvar("L:DCPowerSourceKnob", DCP-1)ipc.control(66587, 8039)elseif DCP ==0 thenend-- CCT Auto Cycle Switchelseif ipcPARAM == 19 thenipc.writeLvar("L:AutoAnticeCycle", 2)ipc.control(66587, 8028)ipc.sleep(200)ipc.writeLvar("L:AutoAnticeCycle", 1)ipc.control(66587, 8027)end I hope this helps you to get more "hardware" control of the brilliant J41.Richard Cooke
November 26, 200916 yr This Rocks! You guys are going to make me either have to build another switch panel or buy another Go Flight module; either way I love it Keep 'em coming...How 'bout a a prop sync switch or the amber attention getter reset switch? :( Both of your guy's work should be stickied now that this is a separate forum :( Thanks So Much!!!Robert Thomason RE Thomason Jr.
November 26, 200916 yr Hey Richard,do you want to post this codes also at Petes forum, please?there are some sticky posts with codings already and you can put this into the J41...would be great to collect it there.If you don't have an account and don't want to make one I can post this for you there.... Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
November 27, 200916 yr How does a LUA file work? Where do you place it and what does it do?PS Forgive my ignorance. Andrew Dixon"If common sense was compulsory everyone would have it but I am afraid this is not the case"
November 27, 200916 yr PS Forgive my ignorance.No, follow the link in the first topic and/or got to the FSUIPC forum and you will find a lot of information about :( Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
November 27, 200916 yr Author Robert - Thanks for the feedback. Glad you liked it. I'm running out of switches as well! The Prop Synchro Switch is quite simple. Find this final section of the Lua file starting -- CCT Auto Cycle SwitchPaste this in before it (inserting not overwriting anything)-- PROP SYNC SWITCH TOGGLEif ipcPARAM == 19 then PSync = ipc.readLvar("L:PropSync")elseif PSync == 1 thenipc.writeLvar("L:PropSync", 0)ipc.control(66587, 8027)elseif PSync== 0 thenipc.writeLvar("L:PropSync", 1)ipc.control(66587, 8028)endThen again find the lines -- CCT Auto Cycle Switchelseif ipcPARAM == 19 thenand change 19 to 20.That should be it. This then gives you 19 Prop Synchro Switch20 CCT Auto Cycle SwitchThe Yellow warning light switch is more difficult. There is a Lua command for it but that clearly isn't the only thing happening and it doesn't work on its own. If I get it to work I'll post it here. Richard Cooke
November 27, 200916 yr Everyone who works on this: thanks a lot! I still think it's very strange PMDG did not provide this by itself, but I'm glad this community solves this problem. I'm currently working on a pdf file with all the keyboard commands and how to make them work. Hopefully this can be a sticky in the future or a part of the ops pages to make it possible for everyone to use their hardware with the JS41.
November 27, 200916 yr Author Guenter - Thanks - I've posted this over at the Simflight/FSUIPC forum but as a new post. I realise now :( I should probably have added it to your "stickied" topic. I'm happy if you want to put a link in with your topic or to copy the whole lot if you want to or do you think we should put together a single Lua file with all these commands? Thanks again for getting me started on this.Richard Cooke
November 29, 200916 yr Richard,Thanks again for your work.I tried adding the code for the prop sync and CTT cycle, the CTT cyle works (didn't need that one too bad because Guenter Steiner already provided it in his .lua) however I could not get the prop sync to function, will try again in the mornng maybe I'm just tired?Respectfully,Robert RE Thomason Jr.
November 29, 200916 yr Author Robert - Odd - mine is working fine. I posted a new complete file with the Prop Syncro switch in here. FSUIPC Forum and J41 You could try using that maybe. I left the CCT part in because if I take it out nothing works! Bizarre. I can't fathom out why. Hope you get it fixed. Richard Cooke
Create an account or sign in to comment