Jump to content
The simFlight Network Forums

rotorhub66

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by rotorhub66

  1. Thank you! As expected the error was approx 40 cm from the screen. Now it worked. Arild
  2. Hi Pete Thank you for your excellent support. It is probably me not understanding the concept fully. But I have read the forums trying to do it right. But something is missing. Here is the log: ********* FSUIPC4, Version 4.92 by Pete Dowson ********* Running inside FSX on Windows 7 Module base=6E6C0000 User Name="Arild Elverum" User Addr="arild@xxx" FSUIPC4 Key is provided WideFS7 Key is provided 16 System time = 01/10/2013 07:32:04 31 FLT UNC path = "\\ARILDS-PC\FSPLANS\" 78 Trying to connect to SimConnect Acc/SP2 Oct07 ... 94 FS UNC path = "\\ARILDS-PC\Microsoft Flight Simulator X\" 999 LogOptions=80000000 00000001 999 SIM1 Frictions access gained 999 Wind smoothing fix is fully installed 999 G3D.DLL fix attempt installed ok 999 SimConnect_Open succeeded: waiting to check version okay 999 Trying to use SimConnect Acc/SP2 Oct07 3261 Running in "Microsoft Flight Simulator X", Version: 10.0.61637.0 (SimConnect: 10.0.61259.0) 3261 Initialising SimConnect data requests now 3261 FSUIPC Menu entry added 3339 \\ARILDS-PC\Microsoft Flight Simulator X\FLIGHTS\OTHER\FLTSIM.FLT 3339 \\ARILDS-PC\Microsoft Flight Simulator X\SimObjects\Airplanes\Aircreation_582SL\Aircreation_582SL.AIR 25522 System time = 01/10/2013 07:32:30, Simulator time = 07:32:08 (14:32Z) 25522 Aircraft="Aircreation582SL red" 26520 Starting everything now ... 76378 Advanced Weather Interface Enabled 78703 LUA.0: beginning "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\Rotaries.lua" 78703 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:1 78703 LUA.0: Global: ipcPARAM = 0 78703 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:2 78703 LUA.0: Global: Vendor = 0x16C0 78703 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:3 78718 LUA.0: Global: Product = 0x27CB 78718 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:10 78718 LUA.0: Global: Device = 0 78718 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:16 78718 LUA.0: Global: Rotaries = table: 0D15F4A0 78812 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:18 78828 LUA.0: Global: dev = 0 78828 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:19 78828 LUA.0: Could not open HID 78828 LUA.0: ...es\Microsoft Flight Simulator X\Modules\Rotaries.lua:20 133756 \\ARILDS-PC\Microsoft Flight Simulator X\SimObjects\Airplanes\Maule_M7_260C\Maule_M7_260C.AIR 133943 Aircraft="Maule M7 260C paint1" 180634 Sim stopped: average frame rate for last 46 secs = 21.9 fps 190945 System time = 01/10/2013 07:35:15, Simulator time = 07:33:08 (14:33Z) 190945 *** FSUIPC log file being closed Average frame rate for running time of 61 secs = 22.0 fps G3D fix: Passes 9758, Null pointers 0, Bad pointers 0, Separate instances 0 Memory managed: 50 Allocs, 50 Freed ********* FSUIPC Log file closed *********** LUA Script: Vendor = "0x16C0" Product = "0x27CB" Device = 0 -- Multiple devices of the same name need increasing Device numbers -- Use separate Lua plug-ins for separate cards! -- NOTE: this can handle up to 16 rotaries only, using the first 64 "virtual buttons" -- List the pairs here: Rotaries = { 0.1,6,7,10,11} -- Example { 31, 30, 25, 22 } would be 31+30 for one, 25+22 for the next, and so on -- Which is clockwise and which counterclockwise doesn't matter -- you'll get -- fast and slow of each in any case dev, rd, wrf, wr, init = com.openhid(Vendor, Product, Device, Report) if dev == 0 then ipc.log("Could not open HID") ipc.exit() end -- Set the boundary time in milliseconds between -- "fast" (shorter) and "slow" (longer) signalling FastTimeLimit = 60 -- Adjust to taste -- Polling time in milliseconds: should be much shorter than -- the boundary time Pollrate = 20 -- same as 50 times per second -- Initialise variables used to keep track of things LastTimes = {} Buttons = 0 PrevButtons = 0 Diff = 0 -- This function will be called by a time event, set at the end of the program before exit. function poll(Time) -- read any data available from the device (only need most recent report) data, n = com.readlast(dev, rd) if n ~= 0 then -- Data was returned, so get the status of all the possible "buttons" we are using -- one value of 32 bits Buttons = com.gethidbuttons(dev, data) -- See if any changes occurred: Diff = logic.Xor(Buttons, PrevButtons) PrevButtons = Buttons if Diff ~= 0 then offset = 0x3340 buttonbit = 1 j = 1 while Rotaries[j] ~= nil do mask = logic.Shl(1, Rotaries[j]-1) if logic.And(Diff,mask) ~= 0 then -- This one changed -- See if changed in less than the "boundary" time thisbutton = buttonbit if (LastTimes[j] ~= nil) and ((Time - LastTimes[j]) < FastTimeLimit) then thisbutton = buttonbit + buttonbit -- Use next higher button for fast end LastTimes[j] = Time -- Toggle a virtual button accordingly ipc.togglebitsUB(offset, thisbutton) end j = j + 1 buttonbit = 4 * buttonbit if logic.And(j,15) == 0 then buttonbit = 1 offset = offset + 4 end end end end end event.timer(Pollrate, "poll")
  3. I have tried to make this work with my Desktop Aviator encoder panel, but no luck. FSUIPC does not read anything else but the real buttons. I have tried different changes according to other posts, and also other related scripts like IPCready.lua. The encoders are Panasonic type at they are set at 88 ms according to the manual for the 2090 board. However, I did check the site, and it is recently changed to 104 ms. I will test this later. The script was modified for the encoder pairs on my board, and the vendor and product from the HID log. I have added the script to the AUTO section (FSUPC.ini), and also added buttons for start and kill. Are there anything else I need to do with the FSUIPC.ini. I should probably declare ignore buttons, but I think this is not essential before I can make it read fast and slow. Any advice for problem solving is welcome. Regard Arild
  4. Hi! Does anyone have the rotaries.lua script. It is mentioned in the documentation, but it is not in the download package or installation file. I just wired up a rotary encoder board to my console, and would like to try the virtual buttons for faster rotation of the OBS and HDG. I found some info in the forum, but would like to compare, if any changes. Thanks Arild E
  5. I have learned a lot today, and discoverd how powerful FSUIPC really is. I have mostly used for default axis and button assignments. I used the macro file with VASfmc, and was very pleased with that. The Lvar extraction did read 1 and 0, but it did not work. I set the parameter as you described. The only visible response was the VC gauge animation (button) in/out. However the OFFSET DWORD worked like a charm. I also found som LUA examples that I might try out. I have ordered some Thrustmaster MFD's today based on my initial testing. I will make a 2D panel for my project, and create a nice LCD overlay for the MFD''s. Regards rotorhub66
  6. Sorry about the last post. OFFSET DWORD worked well. Thank you! Regards Rotorhub66
  7. I got the Lvars to trigger the VC button, but nothing happens in the MFD. I found an example of this approach here; http://www.a2asimulations.com/forum/vie55&t=19524 I sees to work for him. Do I need to pass on some other information in the MACROS file. Here is the testfile for the left MFD: [MACROS] 1=L:ddi_l_btn_00=SET 2=L:ddi_l_btn_01=SET 3=L:ddi_l_btn_02=SET 4=L:ddi_l_btn_03=SET 5=L:ddi_l_btn_04=SET 6=L:ddi_l_btn_05=SET 7=L:ddi_l_btn_06=SET 8=L:ddi_l_btn_07=SET 9=L:ddi_l_btn_08=SET 10=L:ddi_l_btn_09=SET 11=L:ddi_l_btn_10=SET 12=L:ddi_l_btn_11=SET 13=L:ddi_l_btn_12=SET (This is the menu button which triggers in VC) 14=L:ddi_l_btn_13=SET 15=L:ddi_l_btn_14=SET 16=L:ddi_l_btn_15=SET 17=L:ddi_l_btn_16=SET 18=L:ddi_l_btn_17=SET 19=L:ddi_l_btn_18=SET 20=L:ddi_l_btn_19=SET Anyone with an idea or example? Rotohub66
  8. Thank you for your swift reply! I will dig into this now, even if it is new territory for me. Thank you for providing great software. Rotorhub66
  9. I am experimenting with the default (Accelleration) F-18 MFD in a home cockpit project. Is there a way I can trigger det line select buttons from a HID, by accessing the vc button definitions. I have checked the model file and found these parameters for the three MFD's 1-20 buttons: (L:ddi_l_btn_01,number) 50 (L:ddi_c_btn_01,number) 50 (L:ddi_r_btn_01,number) 50 I have logged events in FSUIPC, but all I got is this type of information. 142070 *** EVENT: Cntrl= 69900 (0x0001110c), Param= 0 (0x00000000) 144972 *** EVENT: Cntrl= 69907 (0x00011113), Param= 0 (0x00000000) If possible at all, can someone point me in the right direction so I can map this is FSUIPC. Thank you! Rotorhub66
×
×
  • 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.