Jump to content
The simFlight Network Forums

prokopiu

Members
  • Posts

    40
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    Munich

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

prokopiu's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Hi, Pete is right - the NGX CDU can be driven by a combination of controls. You cannot assign this directly but make use of lua scripting and you can assign. Either make a lua for every key (not a good idea) or use my script in the contribution section - (which you should have already, Gerard). Hopefully LINDA will eventually support CDU I or II as a device - at the moment I have a hack but don't want to publish this as it messes in the LINDA system files and I don't want to support people to get that right. Basically the NGX CDU can be addressed in LUA with the sequence of: function key_press(icode) ipc.control(icode,4194304) ipc.sleep(1) ipc.control(icode,131072) ipc.sleep(1) ipc.control(icode,536870912) end and then for example: function MN_LEGS_press() key_press(70184) end There is a code for every key. Kosta
  2. Hi, I have my CDU I connected and do the following: a function to press the key: function key_press(icode) ipc.control(icode,4194304) ipc.sleep(1) ipc.control(icode,131072) ipc.sleep(1) ipc.control(icode,536870912) end And then the individual keys code with your method: if ipcPARAM == 101 then key_press(70166) elseif ... Hope that help Kosta
  3. Hi, I guess The Ghost is using the FSUIPC Exporter of Eric Marciano which is the only way to export FSUIPC offsets from Wilco Airbusses (I have that as well). It costs money though and only has 5 or 10 minutes before it stops working if you have not payed Eric and received a license code in return. Kosta
  4. Here are some more scripts for the CDU. These ones need FSUIPC macro files also placed in the modules folder of FS. Take away all the .txt endings for the stuff to work. If you want to change the macro filename because you have one already then change the filename and edit the corresponding XXX_CDU.lua replacing all XXX: with NEW: in the ipc.macro() calls. * ISG_CDU for Ernie Alstone's great Integrated Simvionics Gauges (the Boeing CDU Gauge - and I now I mistyped the macro name) * ATR_CDU with the great Flight 1 ATR 72 which is still my favourite Turbo Prop (tha macro file contains much more then needed - also used for MCP Combo though not finished yet) Kosta ATR.MCRO.txt ATR_CDU.lua.txt ISG_CDU.lua.txt IGS.MCRO.txt
  5. Hi, I recently bought myself the VRInsight CDU I (no screen) and as usual with SerialFP2 you hit these limitations with certain aircraft or things like vasFMC. So, I created the same solution which I have already used for my VRi MCP Combo for the CDU I. Chances are that the CDU II (the one with screen) uses the same codes and therefore the solution could work here as well. If someone tries and succeeds please let me know. I attach a description and some sample Luas for you guys to try. Remove the .txt ending and place in the modules folder. The CDU_Lua_general is just a skeleton for you to fill with your own scripting. Kosta AirbusX_CDU.lua.txt CDU_Lua_general.lua.txt Fokker_CDU.lua.txt VRInsight_CDU_and_FSUIPC_V10.pdf
  6. Hi, a couple of months later and I have actually moved to the next level thanks to a simmer/programmer called Artem Crum. He developed LINDA which is a great way of assigning those Lua scripts one has found with a Joystick or the MCP Combo. I helped testing it and also created a profile for one of the planes /more are actually in the queue but I had not yet time enough to test them). Some of what I explained here applies in LINDA as well and if you cannot find your addon in the ever growing list of supported planes then you can use that great editor in LINDA and creat your own scripts. See http://fs-linda.com/ for more. Kosta
  7. Hi Jose, I don't have Go-Flight MCP but the VRInsight MCP Combo but I use it to control vasFMC 2.1 via Lua (actually it is the new tool LINDA I use which unfortunately does not yet support GoFlight hardware). vasFMC 2.1 has now FSUIPC offsets (see documentation) and with these offsets you can trigger changes in the A/P settings or EFIS. With the GoFlight Lua library you can interface with your hardware. The rest is something like: handle event from GoFlight write appropriate value to the vasFMC offset e.g. To toggle the Flight Director in vasFMC use ipc.writeUB(0x6dd5,22) Kosta
  8. Hi, for one - there is a way to connect the VRInsight Combo with FSX without SerialFP or VSPE only based on registered FSUIPC. I use this with practically all my airplanes. see here I do not have the Beech Duchess and can therefore not give you a ready to go solution but when I add a new airplane which is not all standard FSX I do a couple of "investigations" to figure out how to connect the MCP to it. The ideal case is that there are FSUIPC offsets defined - either the standard FSX ones or in some cases special ones. Not quite so ideal but still easy enough is that the aircraft and the panels use XML coding and expose a number of L: variables which can be used. You usually find a .cab file for gauges in that case. The AirbusX is such a plane - normal macro recording does not work here. Most PMDG airplanes use a mix of custom controls and default FSUIPC offsets. For debugging I use a lua script which comes with FSUIPC that dumps L: variables, FSInterrogate is a tool to check FSUIPC offsets and the FSUIPC logging of events and controls is also a good source. Hope that helps Kosta
  9. Dear Kosta,

    thank you for your great work on the LUA script. May I know have you developed the LUA module for WILCO Airbus Evolution? Many thanks!

  10. Hi, I assume we are talking about the VRInsight MCP Combo, right? If so I have connected pretty much all my aircraft via Lua scripting. I do not have the QW757 but it seems you have quite nicely established some L:Vars to go with your aircraft. It appears that the way you use inc and dec on L:alt_sel_num makes increases of one. Another way to deal with this could be to have the MCP trigger the normal altitude change via FS controls. This probably does not update the QW757 LVar so you would have to transfer the current value in the respective FSUIPC offset to your LVar. For this you can use an event handler in a small lua file that would need to be started when your QW757 is started. The code could look like this (assuming the full altitude in feet is what needs to be put into the alt_sel_num variable: qw757alt.lua: (do not include the ===) ================ function setAPALT(offset, value) buffer = ipc.readUD(0x07D4)/65536*3.28 ipc.writeLvar("L:alt_sel_num", buffer) end event.offset(0x07D4, "UW", "setAPALT") ================= You have to put the file in the modules folder and use fsuipc.ini to start up or program a key or whatever else. It will continue running and every time you modify the AP altitude setting via keys, clicks or by having the MCP make the change it will trigger, retrieve the value and write it complete into the LVar. Now, I did this blindly - you might have to modify the logic to suite your aircraft. Hope it helps. [EDIT by Pete: I've corrected the Event call for you -- you'd left it as 7CC and setAPHDG for a heading setting] Kosta
  11. Hi Surfman, I am assuming that you set one key with Lua Loglvars and the other with LuaKill Loglvars. The instructions are correct and it works fine here. I think that the Wilco CRJ might NOT have ANY LVars and therefore the script stops again entirely on it's own since it makes no sense looping and detecting changes on non-existing variables. There is a simple way to test this, use a different plane like the B737-800 and if your red window appears you know that it works. The 2D 3D window makes NO difference. Kosta
  12. Hi Fouad, I use FSCONV to connect my VRInsight MCP hardware with the Level-D 767. The way FSCONV works with its regular scans of the Level-D components (of which it can do max. 12 parameters a second) could be the reason for the mismatch. I made sure that only the parameters I absolutely need for the MCP Combo are activated and I also read out once per second. Try optimizing FSCONV by turning off all the parameters except the one for the MESM selectors (save your current profile in FSCONV under a different name first so you can recover the current settings) and try again - using a higher frequency for scanning. If your engine selectors do work properly you have found the reason. GoFlight hardware or FSUIPC are probably not the reason. The Lua scripting is indeed an interesting option although you need some programming experience. There is a good support for GoFlight hardware with the gdf library offering scripted reading of GoFlight parameters. So, if optimizing FSCONV does not work, you could create a Lua script which reads the position of the switches on the MESM and makes sure that the Level-D get the same values... Kosta
  13. Next part is displaying A/P values and handling radios: The VRInsight MCP Combo has 2 displays, one in the middle with the Autopilot values (SPD, HDG, ALT) and on the right side the multi-purpose display for the radios. The content of the displays cannot be read by the Lua script - only changed by sending commands via the serial port to the MCP Combo. In order to keep MCP display and real values aligned you need to install an event handler for each value that triggers when the FSX value changes. The corresponding display is then updated by sending a command. The middle display: SPD*.... HDG* ALT* 999 .... 999 99999 You can change the following parts: Value Command ========================================= SPD value SPD999 (speed in kts) Top .... area DSP XXXX (XXXX being a 4 character text) Bottom .... DSP_XXXX HDG value HDG999 (heading 3 digit degree) ALT value ALT999 (altitude in thousands of feet) For many planes the standard FSX offsets work as a source for the values in Lua scripting: function setAPSPD(offset, value) buffer = ipc.readUW(0x07e2) com.write(dev, string.format("SPD%03d", buffer),8 ) end function setAPHDG(offset, value) buffer = ipc.readUW(0x07CC)/65536*360 com.write(dev, string.format("HDG%03d", buffer),8 ) end function setAPALT(offset, value) buffer = ipc.readUD(0x07D4)/65536*3.28/100 com.write(dev, string.format("ALT%03d", math.ceil(buffer)),8 ) end The Radio Panel display has two lines for displaying radio values and six mode buttons: [LINE 1 ] [LINE 2 ] [ ] [ ] [ ] [ ] [ ] COM NAV ADF DME TRN Commands to be used: Command Display ============================================ COMSEL1 COM1 frequencies COMSEL2 COM2 frequencies NAVSEL1 NAV1 frequencies NAVSEL2 NAV2 frequencies ADFSEL1 ADF1 frequency ADFSEL2 ADF2 frequency DMESEL1 Display DME1 dist/speed DMESEL2 Display DME2 dist/speed TRNSEL Transponder display COMs9999 Set COM1 standby freq 199.99 COMx9999 Set COM1 active frequeny 199.99 COMS9999 Set COM2 standby freq 199.99 COMX9999 Set COM2 active frequeny 199.99 NAVs9999 Set NAV1 standby freq 199.99 NAVx9999 Set NAV1 active frequeny 199.99 NAVS9999 Set NAV2 standby freq 199.99 NAVX9999 Set NAV2 active frequeny 199.99 ADF99999 Set selected ADF frequency to 9999.9 TRN9999 Set transponder display to 9999 DMiAAAA Set DME1 VOR name to AAAA DMEd9999 Set DME1 distance to 999.9 NM DMEs999 Set DME1 speed to 999 KT DMIAAAA Set DME2 VOR name to AAAA DMED9999 Set DME2 distance to 999.9 NM DMES999 Set DME2 speed to 999 KT In Lua scripting one needs to get these values from their respective FSUIPC offsets. Most planes use the FSX standard offsets so the code lines here work almost all the time: function setCOM1Radio(offset, value) buffer = ipc.readUW(0x034E) com.write(dev, string.format("COMx%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x311A) com.write(dev, string.format("COMs%04x", buffer),8 ) end function setCOM2Radio(offset, value) buffer = ipc.readUW(0x3118) com.write(dev, string.format("COMX%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x311C) com.write(dev, string.format("COMS%04x", buffer),8 ) end function setNAV1Radio(offset, value) buffer = ipc.readUW(0x0350) com.write(dev, string.format("NAVx%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x311E) com.write(dev, string.format("NAVs%04x", buffer),8 ) end function setNAV2Radio(offset, value) buffer = ipc.readUW(0x0352) com.write(dev, string.format("NAVX%04x", buffer),8 ) ipc.sleep(500) buffer = ipc.readUW(0x3120) com.write(dev, string.format("NAVS%04x", buffer),8 ) end function setADF1Radio(offset, value) buffer = ipc.readUW(0x034C) buffer2 = ipc.readUW(0x0356) com.write(dev, string.format("adf%01x%03x%01x", buffer2/256, buffer, buffer2 % 0x0100),8 ) end function setADF2Radio(offset, value) buffer = ipc.readUW(0x02D4) buffer2 = ipc.readUW(0x02D6) com.write(dev, string.format("ADF%01x%03x%01x", buffer2/256, buffer, buffer2 % 0x0100),8 ) end function setTransponder(offset, value) buffer = ipc.readUW(0x0354) com.write(dev, string.format("TRN%04x", buffer),8 ) end In order to keep the displays updated and in synch, event listeners are added at the end of the lua script to be triggered whenever one of the offsets change. So when you or the FMC changes the NAV1 frequency, the event is recognized and the setNAV1Radio function is called. The events are declared like that: -- listen to changes of the Radions event.offset(0x034E, "UW", "setCOM1Radio") event.offset(0x311A, "UW", "setCOM1Radio") event.offset(0x3118, "UW", "setCOM2Radio") event.offset(0x311C, "UW", "setCOM2Radio") event.offset(0x0350, "UW", "setNAV1Radio") event.offset(0x311E, "UW", "setNAV1Radio") event.offset(0x0352, "UW", "setNAV2Radio") event.offset(0x3120, "UW", "setNAV2Radio") event.offset(0x034C, "UW", "setADF1Radio") event.offset(0x0356, "UW", "setADF1Radio") event.offset(0x02D4, "UW", "setADF2Radio") event.offset(0x02D6, "UW", "setADF2Radio") event.offset(0x0354, "UW", "setTransponder") To detect changes to the frequency entered in the MCP you need to detect the VRI event (the action code sent by the MCP) and react accordingly. Sample for COM1 and ADF2: -- detect the change of standby freq if string.match(str, "COMs(%d%d%d%d)") then comfreq = tonumber(string.match(str, "COMs(%d%d%d%d)"),16) ipc.writeUD(0x311a, comfreq) end -- detect the transfer of standby to active frequency if string.match(str, "COMx(%d%d%d%d)") then ipc.control(66372) end -- detect what ADF has been selected if str == "ADFSEL1" then ipc.set("adfsel",1) end -- detect what ADF has been selected if str == "ADFSEL2" then ipc.set("adfsel",2) end -- set ADF frequency based on two offsets if string.match(str, "ADF(%d%d%d%d%d)") then comfreq = tonumber("0x0" .. string.sub(str, 5,7), 16) adffreq = tonumber("0x0" .. string.sub(str, 4,4) .. "0" .. string.sub(str,8,8 ),16) if (ipc.get("adfsel") == 1) then ipc.writeUD(0x034C, comfreq) ipc.writeUD(0x0356, adffreq) else ipc.writeUD(0x02D4, comfreq) ipc.writeUD(0x02D6, adffreq) end end Kosta
  14. The next step with having the Lua script work with my MCP Combo is to be able to automatically start the appropriate Lua script for each individual airplane. There seem to be some ways to do this, the most flexible I found was to use Lua scripting again and facilitate the Lua macros (pretty much like you would when selecting something in the drop-downs for key or button assignments). In Lua there is the ipc.macro("name of macro") with which one can start, re-start or kill a running Lua script. Perfect for me. For example, having the Other_VRIH.lua file from my previous post I could start it by using the line: ipc.macro("Lua Other_VRIH") If I want to stop it because I would like to call another one (for another aircraft) I can use: ipc.macro("LuaKill Other_VRIH") In combination with the name of the currently loaded aircraft coming from the FSUIPC offset 0x3D00 I can start and switch VRInsight Handler Luas whenever I switch airplanes in FSX. Since the names of several variations (textures) of FSX planes usually start with the same text you can start the same lua script by providing the common part of the name (e.g. "Level D Simulations B767" covering all available types). I have my current version of the dispatcher Lua attached here. Make sure it gets started when FSX starts. It will take care of the rest then. Kosta LuaDispatcher.lua.txt
  15. Hi all, having a week off after Easter gave me some time to start a little project of documenting all the findings and results of me using FSUIPC and Lua scripting to connect all kinds of aircraft with my VRInsight MCP Combo. I found a way to do this without virtual serial ports or SerialFP and learnt an awfull lot on the way there. Time to document this in a growing topic. First installment is the setup of FSUIPC and VRInsight hardware to talk directly to each other. The attached PDF documents this approach and the text file is a sample for that kind of lua script I am talking about. In the coming days and weeks I will add more to this thread, also going into more details about individual planes from PMDG to Level-D and so forth for which I have collected quite some details about how to connect something like the MCP Combo to them. The knowledge here can also be applied to the Go-Flight MCP - you probably have to change some aspects of the scripts though as one connects differently to the Go-Glight stuff. Kosta VRInsight_MCP_and_FSUIPC_V10.pdf Other_VRIH.lua.txt
×
×
  • 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.