Jump to content
The simFlight Network Forums

roarkr

Members
  • Content count

    41
  • Joined

  • Last visited

Community Reputation

0 Neutral

About roarkr

  • Rank
    Advanced Member
  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

Profile Information

  • Gender
    Male
  • Location
    Norway
  1. Multiple Controllers

    Hi, Thanks for replying. I will try it.
  2. Hi, I am using P3Dv4 with FSUIPC 5 and have a PMDG B737NGX home cockpit based on Opencockpits hardware modules and my OC4BAv4 home cockpit program. This is my controller that should all be connected all the time. 1. Saitek x52 2. Saitek Rudder 3. Opencockpits B737 Yoke 4. CFY Throttle When I use my home cockpit and fly the B737NGX, I use the Opencockpits Yoke, Saitek Rudder and CFY Throttle. When I just fly in P3Dv4 using my 4K monitor (not my home cockpit setup) I only want to use my Saitek X52 for both PMDG B737NGX and other airplanes. Now my question: How do I set up the controllers to have a working controller scenario that let my use them as described above?
  3. Thanks, I have tried with this SimConnect variable, but can't get any values when moving the throttle lever. In FSUIPC the offset is S16 type, shouldn't it then in SImConnect be a INT32 datatype? It also says unit is Precent over 100. Are you doing any calculation of the SImConnect variable from precent to the -4096 tp 16384 value range before adding to the offset 088C?
  4. Looking in the "FSUIPC4 Status of IPC Offsets for FSX" list you state that the offset 088C for TQ Lever position is a "Ok-SimC works okay using SimVars". Does this means that it is a variable that is defined and can be used directly with SimConnect without FSUIPC? If so, can you tell med the name of the SimConnect variable you are using to get the value to the FSUIPC offset 088C? I can't find it in the SimConnect documentation, that's the reason for my question.
  5. Hi, I have developed an interface app for Opencockpits hardware to be used with Aerosoft's new Airbuses. I have partly used Lua scripting and FSUIPC offsets and need an offset range like 66C0 - 66FF for this app so it doesn't interfere with other usage. I am using the free offset 66C0 - 66FF now, but some users do have some problems as they also run other apps that uses some of these free offsets. I read in the doc that you could provide developers with that if they contacted you. Can you provide that? Roar
  6. PMDG NGX SDK

    hi, just wanted to inform you that a beta version of my OCP4NGX app for interfacing OpenCockpits MCP has been sent to OpenCocpits for test and verification. You can read and write everything that is in the SDK. ( today only MCP is implemented) This is in agreement and permission of PMDG. More modules will be incorprated later together with the future 777 and 747 if those SDK become available. It is freeware. Release will be soon.
  7. PMDG NGX SDK

    Hi Pete, I'm almost ready with my new OpenCockpits IOCP Client for NGX based on the new NGX SDK, but need to make it a little more efficient. You mentioned in this thread some time ago that using a loop for the CallBack MyDispatchProc was not recommended, but instead: " The method I recommend is to use Simconnect_Open with your message-only (HWND_MESSAGE class) Window handle as the 3rd parameter and a user message number defined by you as the 4th parameter. Then you call "CallDispatch" when you receive that message. This is bay far the most efficient method." Could you specify this in more detail as I can't figure out the coding for that. rgs Roar
  8. Hi, That fine, hope it doesn't drag out for months. For me the best solution will be using FSUIPC4 together with LUA scripts, so I wait for it. rgs
  9. Hi Pete, I have started to modify an IOCP Client C++ module I got from lekseecon.com in order to connect my OpenCockpits modules to the NGX plane. After some time struggling with this approach, I now see this will a huge development task and at the same time I'm more and more believing that a solution based on FSUIPC4 offsets and LUA scripting will be much easer to implement, but then I need the NGX SDK variables to be connected to FSUIPC4 offsets. In order to decide which way to go I wonder if you now have heard from PMDG regarding the EULA concern you had and if you still are planning to make the NGX variables available as FSUIPC4 offsets. rgs, Roar
  10. PMDG NGX SDK

    Hi I have downloaded your PMDGWrapper to see if I can use some of your coding in a IOCP Client C++ I am coding to interface my Opencockpits hardware modules. As I am not a professional C++ programmer I don't know what the wrapper really is and what it actually does. Could you explain a little for us "hobby" programmers? What I really need is a call from your wrapper dll ( if I understand it right) to a function in my C++ whenever there is a change between old and new values of the PMDG data. This call should have both the varname and the value. I have a hard time to find out what is the ins and what is the outs in this dll of if it can be used. Maybe I am totally misunderstanding it. Do you have any idea of how this could be done? rgs
  11. PMDG NGX SDK

    Hi Pete, I don't know what your plans are about doing something for the PMDG NGX in your FSUIPC4 now that the SDK is available. As Nico don't wanna do a "lekseecon" for the PMDG NGX I have started to make my own " NGXCon" IOCP client to be used for the OpencCockpits SIOC environement. But, as I am not a "prof" programmer this can take some time before I'm ready. So to my question: Are you going to do what you said: "" I'm starting to wonder if it wouldn't be much tidier to forget the Lua way of doing it altogether, and just have an EXE program which gets the NGX data and posts them to assigned FSUIPC offsets, which can then be read by any Lua plug-ins, and other programs, even on a WideFS client. I would actually consider building this into FSUIPC (it is easy as it already has a working SimConnect interface),"" if so what and what is your timeframe? Then I could do the LUA scripting to get what I want and that is maybe the way to go instead of an dedicated IOCP client based on C++ ( which I need to learn better). rgs
  12. PMDG NGX SDK

    Hi, The way I have implemented this, yes. The OP sioc software is a event driven program. It does only execute code when a variable change value. Either a variable connected to a specific IOCARD input or a variable linked to a offset. rgs
  13. PMDG NGX SDK

    Hi, Here is an example of how to use events to detect offsets changes, both on bit level and whole words. Keep in mind that I'm not a programmer, so it maybe can be done better. rgs Roar -- PMDG 737 NGX LUA code for Opencockpits MCP to be used in FSUIPC -- File: NGXMCP_202 -- December 2011 -- Roar Kristensen --*************************************************************************************** -- ** System initial values set ** --*************************************************************************************** -- ** MCP initial values ** hdg_mode = 1 atarm = -1 crsl = 500 crsr = 500 spd = -1 hdg = -1 alt = -1 vsw = -1 MCP_N1 = -1 MCP_Speed = -1 MCP_LvlChg = -1 MCP_VNav = -1 MCP_LNav = -1 MCP_HdgSel = -1 MCP_AltHold = -1 MCP_CMDA = -1 MCP_CMDB = -1 MCP_CWSA = -1 MCP_CWSB = -1 MCP_VORLock = -1 MCP_App = -1 MCP_VS = -1 ipc.writeUB("66E8", 0) ipc.writeUB("66E9", 0) ipc.writeUB("66EA", 0) ipc.writeUB("66EB", 0) ipc.writeUB("66EC", 0) ipc.writeUB("66ED", 0) if ipc.readUB("66E4") == 1 and ipc.readLvar('ngx_switch_378_a') == 100 then ipc.control(70010, 536870912) ipc.control(70010, 131072) else if ipc.readUB("66E4") == 0 and ipc.readLvar('ngx_switch_378_a') == 0 then ipc.control(70010, 536870912) ipc.control(70010, 131072) end end if ipc.readUB("66E5") == 1 and ipc.readLvar('ngx_switch_380_a') == 100 then ipc.control(70012, 536870912) ipc.control(70012, 131072) else if ipc.readUB("66E5") == 0 and ipc.readLvar('ngx_switch_380_a') == 0 then ipc.control(70012, 536870912) ipc.control(70012, 131072) end end if ipc.readUB("66E6") == 0 and ipc.readLvar('ngx_switch_406_a') == 100 then ipc.control(70038, 536870912) ipc.control(70038, 131072) else if ipc.readUB("66E6") == 1 and ipc.readLvar('ngx_switch_406_a') == 0 then ipc.control(70038, 536870912) ipc.control(70038, 131072) end end if ipc.readUB("66E7") == 1 and ipc.readLvar('ngx_switch_407_a') == 100 then ipc.control(70039, 536870912) ipc.control(70039, 131072) else if ipc.readUB("66E7") == 0 and ipc.readLvar('ngx_switch_407_a') == 0 then ipc.control(70039, 536870912) ipc.control(70039, 131072) end end if crsl ~= ipc.readLvar("L:ngx_CRSwindowL") then crsl = ipc.readLvar("L:ngx_CRSwindowL") ipc.writeUW("66C0", crsl) end if spd ~= ipc.readLvar("L:ngx_SPDwindow") then spd = ipc.readLvar("L:ngx_SPDwindow") ipc.writeUW("66C2", spd) end if hdg ~= ipc.readLvar("L:ngx_HDGwindow") then hdg = ipc.readLvar("L:ngx_HDGwindow") ipc.writeUW("66C4", hdg) end if alt ~= ipc.readLvar("L:ngx_ALTwindow") then alt = ipc.readLvar("L:ngx_ALTwindow") ipc.writeUW("66C6", ipc.readLvar("L:ngx_ALTwindow") / 100) end --if ipc.readLvar("L:ngx_MCP_VS") == 1 then if vsw ~= ipc.readLvar("L:ngx_VSwindow") then vsw = -20000 ipc.writeSW("66D0", -20000) end if crsr ~= ipc.readLvar("L:ngx_CRSwindowR") then crsr = ipc.readLvar("L:ngx_CRSwindowR") ipc.writeUW("66CA", crsr) end --*************************************************************************************** -- ** Procedures for reading MCP windows and sending to SIOC via FSUIPC offsets**** --*************************************************************************************** function CRSL_show () crsl = ipc.readLvar("L:ngx_CRSwindowL") ipc.writeUW("66C0", crsl) end function SPD_show () spd = ipc.readLvar("L:ngx_SPDwindow") if spd > 1 then ipc.writeUW("66C2", spd) else spd = spd *100 ipc.writeUW("66C2", spd) end end function HDG_show () hdg = ipc.readLvar("L:ngx_HDGwindow") ipc.writeUW("66C4", hdg) end function ALT_show () alt = ipc.readLvar("L:ngx_ALTwindow") ipc.writeUW("66C6", alt / 100) end function VS_show () vsw = ipc.readLvar("L:ngx_VSwindow") ipc.writeSW("66C8", vsw) end function CRSR_show () crsr = ipc.readLvar("L:ngx_CRSwindowR") ipc.writeUW("66CA", crsr) end --*************************************************************************************** -- ** Procedures for finding changes in MCP windows and MCP function LEDs**** --*************************************************************************************** function run_update (time) if crsl ~= ipc.readLvar("L:ngx_CRSwindowL") then CRSL_show () end if crsr ~= ipc.readLvar("L:ngx_CRSwindowR") then CRSR_show () end if spd ~= ipc.readLvar("L:ngx_SPDwindow") then SPD_show () end if hdg ~= ipc.readLvar("L:ngx_HDGwindow") then HDG_show () end if alt ~= ipc.readLvar("L:ngx_ALTwindow") then ALT_show () end if vsw ~= ipc.readLvar("L:ngx_VSwindow") then VS_show () end if ipc.readLvar("L:ngx_MCP_ATArm") ~= atarm then atarm = ipc.readLvar("L:ngx_MCP_ATArm") ipc.writeUB("66F0", atarm) end if ipc.readLvar("L:ngx_MCP_N1") ~= MCP_N1 then MCP_N1 = ipc.readLvar("L:ngx_MCP_N1") ipc.writeUB("66F1", MCP_N1) end if ipc.readLvar("L:ngx_MCP_SPEED") ~= MCP_Speed then MCP_Speed = ipc.readLvar("L:ngx_MCP_SPEED") ipc.writeUB("66F2", MCP_Speed) end if ipc.readLvar("L:ngx_MCP_VNav") ~= MCP_VNav then MCP_VNav = ipc.readLvar("L:ngx_MCP_VNav") ipc.writeUB("66F3", MCP_VNav) end if ipc.readLvar("L:ngx_MCP_LvlChg") ~= MCP_LvlChg then MCP_LvlChg = ipc.readLvar("L:ngx_MCP_LvlChg") ipc.writeUB("66F4", MCP_LvlChg) end if ipc.readLvar("L:ngx_MCP_HdgSel") ~= MCP_HdgSel then MCP_HdgSel = ipc.readLvar("L:ngx_MCP_HdgSel") ipc.writeUB("66F5", MCP_HdgSel) end if ipc.readLvar("L:ngx_MCP_LNav") ~= MCP_LNav then MCP_LNav = ipc.readLvar("L:ngx_MCP_LNav") ipc.writeUB("66F6", MCP_LNav) end if ipc.readLvar("L:ngx_MCP_VORLock") ~= MCP_VORLock then MCP_VORLock = ipc.readLvar("L:ngx_MCP_VORLock") ipc.writeUB("66F7", MCP_VORLock) end if ipc.readLvar("L:ngx_MCP_App") ~= MCP_App then MCP_App = ipc.readLvar("L:ngx_MCP_App") ipc.writeUB("66F8", MCP_App) end if ipc.readLvar("L:ngx_MCP_AltHold") ~= MCP_AltHold then MCP_AltHold = ipc.readLvar("L:ngx_MCP_AltHold") ipc.writeUB("66F9", MCP_AltHold) end if ipc.readLvar("L:ngx_MCP_VS") ~= MCP_VS then MCP_VS = ipc.readLvar("L:ngx_MCP_VS") ipc.writeUB("66FA", MCP_VS) end if MCP_CMDA ~= ipc.readLvar("L:ngx_MCP_CMDA") then MCP_CMDA = ipc.readLvar("L:ngx_MCP_CMDA") ipc.writeUB("66FB", MCP_CMDA) end if MCP_CWSA ~= ipc.readLvar("L:ngx_MCP_CWSA") then MCP_CWSA = ipc.readLvar("L:ngx_MCP_CWSA") ipc.writeUB("66FC", MCP_CWSA) end if MCP_CMDB ~= ipc.readLvar("L:ngx_MCP_CMDB") then MCP_CMDB = ipc.readLvar("L:ngx_MCP_CMDB") ipc.writeUB("66FD", MCP_CMDB) end if MCP_CWSB ~= ipc.readLvar("L:ngx_MCP_CWSB") then MCP_CWSB = ipc.readLvar("L:ngx_MCP_CWSB") ipc.writeUB("66FE", MCP_CWSB) end end --*************************************************************************************** -- ** MCP switches ******* --*************************************************************************************** function MCP_FD1(off,val) if ipc.readUB("66EF") == 7 then if val == 1 and ipc.readLvar('ngx_switch_378_a') == 100 then ipc.control(70010, 536870912) ipc.control(70010, 131072) else if val == 0 and ipc.readLvar('ngx_switch_378_a') == 0 then ipc.control(70010, 536870912) ipc.control(70010, 131072) end end end end function MCP_ATARM(off,val) if ipc.readUB("66EF") == 7 then if val == 1 and ipc.readLvar('ngx_switch_380_a') == 100 then ipc.control(70012, 536870912) ipc.control(70012, 131072) else if val == 0 and ipc.readLvar('ngx_switch_380_a') == 0 then ipc.control(70012, 536870912) ipc.control(70012, 131072) end end end end function MCP_DISENGAGE(off,val) if ipc.readUB("66EF") == 7 then if val == 0 and ipc.readLvar('ngx_switch_406_a') == 100 then ipc.control(70038, 536870912) ipc.control(70038, 131072) else if val == 1 and ipc.readLvar('ngx_switch_406_a') == 0 then ipc.control(70038, 536870912) ipc.control(70038, 131072) end end end end function MCP_FD2(off,val) if ipc.readUB("66EF") == 7 then if val == 1 and ipc.readLvar('ngx_switch_407_a') == 100 then ipc.control(70039, 536870912) ipc.control(70039, 131072) else if val == 0 and ipc.readLvar('ngx_switch_407_a') == 0 then ipc.control(70039, 536870912) ipc.control(70039, 131072) end end end end function MCP1(off, val) if logic.And(val, 0x0010) ~= 0 then N1 () elseif logic.And(val, 0x0020) ~= 0 then SPEED () elseif logic.And(val, 0x0040) ~= 0 then CO () elseif logic.And(val, 0x0080) ~= 0 then SPD_INTV () elseif logic.And(val, 0x0100) ~= 0 then VNAV () elseif logic.And(val, 0x0200) ~= 0 then LVLCHG () elseif logic.And(val, 0x0400) ~= 0 then HDGSEL () elseif logic.And(val, 0x0800) ~= 0 then HDG_BANK () elseif logic.And(val, 0x1000) ~= 0 then LNAV () elseif logic.And(val, 0x2000) ~= 0 then VORLOC () elseif logic.And(val, 0x4000) ~= 0 then APP () elseif logic.And(val, 0x8000) ~= 0 then ALT_INTV () end end function MCP2(off, val) if logic.And(val, 0x0001) ~= 0 then ALTHLD () elseif logic.And(val, 0x0002) ~= 0 then VS () elseif logic.And(val, 0x0004) ~= 0 then CMDA () elseif logic.And(val, 0x0008) ~= 0 then CWSA () elseif logic.And(val, 0x0010) ~= 0 then CMDB () elseif logic.And(val, 0x0020) ~= 0 then CWSB () end end --*************************************************************************************** -- ** MCP Dials ******** --*************************************************************************************** function CRSL_chg (off,val) if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70008, 16384) ipc.sleep (5) end ipc.writeUB("66E8", 255) CRSL_show () else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70008, 8192) ipc.sleep (5) end ipc.writeUB("66E8", 255) CRSL_show () else if val == 0 then ipc.writeUB("66E8", 0) end end end end end function SPD_chg (off,val) if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70016, 16384) ipc.sleep (5) end ipc.writeUB("66E9", 255) SPD_show () else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70016, 8192) ipc.sleep (5) end ipc.writeUB("66E9", 255) SPD_show () else if val == 0 then ipc.writeUB("66E9", 0) end end end end end function HDG_chg (off,val) if hdg_mode == 1 then if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70022, 16384) ipc.sleep (5) end ipc.writeUB("66EA", 255) HDG_show () else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70022, 8192) ipc.sleep (5) end ipc.writeUB("66EA", 255) HDG_show () else if val == 0 then ipc.writeUB("66EA", 0) end end end end else BANK_chg (off,val) end end function BANK_chg (off,val) if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70021, -2147483648) ipc.control(70021, 524288) ipc.sleep (5) end ipc.writeUB("66EA", 255) else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70021, 536870912) ipc.control(70021, 131072) ipc.sleep (5) end ipc.writeUB("66EA", 255) else if val == 0 then ipc.writeUB("66EA", 0) end end end end end function ALT_chg (off,val) if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70032, 16384) ipc.sleep (5) end ipc.writeUB("66EB", 255) ALT_show () else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70032, 8192) ipc.sleep (5) end ipc.writeUB("66EB", 255) ALT_show () else if val == 0 then ipc.writeUB("66EB", 0) end end end end end function VS_chg (off,val) if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70033, 8192) ipc.sleep (5) end ipc.writeUB("66EC", 255) VS_show () else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70033, 16384) ipc.sleep (5) end ipc.writeUB("66EC", 255) VS_show () else if val == 0 then ipc.writeUB("66EC", 0) end end end end end function CRSR_chg (off,val) if val == 255 then ipc.sleep(0) else if val > 0 then local i for i = 1, val do ipc.control(70041, 16384) ipc.sleep (5) end ipc.writeUB("66ED", 255) CRSR_show () else if val < 0 then val = val* -1 local i for i = 1, val do ipc.control(70041, 8192) ipc.sleep (5) end ipc.writeUB("66ED", 255) CRSR_show () else if val == 0 then ipc.writeUB("66ED", 0) end end end end end --*************************************************************************************** -- ** MCP buttons ************** --*************************************************************************************** function N1 () ipc.control(70013, 536870912) ipc.control(70013, 131072) end function SPEED () if ipc.readLvar("L:ngx_MCP_VNav") == 1 then -- go to SPD_INTV instead ipc.control(70019, 536870912) ipc.control(70019, 131072) else ipc.control(70014, 536870912) ipc.control(70014, 131072) end end function CO () ipc.control(70015, 536870912) ipc.control(70015, 131072) end function SPD_INTV () ipc.control(70019, 536870912) ipc.control(70019, 131072) end function ALT_INTV () ipc.control(70517, 536870912) ipc.control(70517, 131072) end function HDG_BANK () -- toggling HDG / BANK (1/2) -- HDG = 1, BANK = 2 hdg_mode = 3 - hdg_mode end function VNAV () ipc.control(70018, 536870912) ipc.control(70018, 131072) end function LVLCHG () ipc.control(70023, 536870912) ipc.control(70023, 131072) end function HDGSEL () ipc.control(70024, 536870912) ipc.control(70024, 131072) end function LNAV () ipc.control(70029, 536870912) ipc.control(70029, 131072) end function VORLOC () ipc.control(70028, 536870912) ipc.control(70028, 131072) end function APP () ipc.control(70025, 536870912) ipc.control(70025, 131072) end function ALTHLD () if ipc.readLvar("L:ngx_MCP_VNav") == 1 then -- go to ALT_INTV instead ipc.control(70517, 536870912) ipc.control(70517, 131072) else ipc.control(70026, 536870912) ipc.control(70026, 131072) end end function VS () ipc.control(70027, 536870912) ipc.control(70027, 131072) end function CMDA () ipc.control(70034, 536870912) ipc.control(70034, 131072) end function CMDB () ipc.control(70035, 536870912) ipc.control(70035, 131072) end function CWSA () ipc.control(70036, 536870912) ipc.control(70036, 131072) end function CWSB () ipc.control(70037, 536870912) ipc.control(70037, 131072) end --*************************************************************************************** -- ** Routines to detect MCP buttons and dials changes ** --*************************************************************************************** event.offset(0x66E4, "UB", "MCP_FD1") event.offset(0x66E5, "UB", "MCP_ATARM") event.offset(0x66E6, "UB", "MCP_DISENGAGE") event.offset(0x66E7, "UB", "MCP_FD2") event.offset(0x66E0, "UW", "MCP1") event.offset(0x66E2, "UW", "MCP2") event.intercept(0x66E8, "SB", "CRSL_chg") event.intercept(0x66E9, "SB", "SPD_chg") event.intercept(0x66EA, "SB", "HDG_chg") event.intercept(0x66EB, "SB", "ALT_chg") event.intercept(0x66EC, "SB", "VS_chg") event.intercept(0x66ED, "SB", "CRSR_chg") --*************************************************************************************** -- ** Timer for MCP diplays and LED update --*************************************************************************************** event.timer(100, "run_update")
  14. PMDG NGX SDK

    Hi, I have made some lua files that interfaces the PMDG NGX's MCP and EFIS. This was done before the SDK came out. The part interfacing the PMDG NGX via Lvars, ipc.control and ipc.read/write commands are controlled by sioc scripts ( I am using Opencockpits hardware). I am now thinking of writing a C++ program, but I need to study the interface simconnect and C++ a little bit more and also other parts. Why is there any need for FSUIPC4 now that the SDK is available? I had to use FSUIPC before the SDK was available. What I understand is that you need the C++ (dll) to interface PMDG through simconnect and in my case also interface/translate to sioc "language". But, in order to do this, I need to study a little bit more. I don't have any problem using FSUIPC, but to me using SIOC, C++(dll), SImconnect and FSUIPC incl LUA seems to complicated. There must be an easier way of doing this or? rgs
×