Jump to content
The simFlight Network Forums

AurelienF38

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AurelienF38

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  • Location
    france
  1. hi Pete, I have test with the [Auto] section and it's ok! Thank you very much, Aurelien
  2. I completely agree with you, Pete, I stubborn this weekend and accumulated mistakes. After a 48-hour break, I leaned over the problem, and I started all over again. It's good, tonight, my event.lvar scripts work, for all the gauges of the cessna cockpit. 😉 The only thing that does not happen is the launch of the script independently. To do this, I assigned a switch. Thank you for your time. Aurelien
  3. Hi Pete, I will try to answer your questions: / I had a RPM.Lua folder because yesterday, my script "event.Lvar" for RPM worked only on a separate folder. / For the ï character, I had rewrited the script, many times, change his name (C172gauges instead of RMP.lua), but nothing work... / I had check the value in the offset, and there was correct. Now, it's worse... the C172gauges script is not used by FSUIPC. it does not appear in the log file, however, he is mentioned in the FSUIPC.ini... I ask google concerning the error "unexpected symbol near 'ï' ", it could come from the text editor, wich could put hidden special characters. I use Notepad++, and the coding use is UTF-8 (without BOM). All this makes me waste a lot of time...and your tim too..., while finally the script with the form "while 1 do ... ipc.readLvar, ipc.write..." work perfectly... How is the use of "event" better for you? Because, interfacing a cessna, I finally have not a lot of variable to interface, it would not be enough with this form of script? There is some "limits"? thank you for your help. Sorry if I'm stuck. It's incomprehensible for me, but it worked yesterday morning, but it's impossible to redo this "event.Lvar" Aurelien
  4. I don't know why, but I have somethig like this now in the FSUIPC5.log folder, and I think this is want you expect Pete! FSUIPC5 Key is provided WIDEFS7 not user registered, or expired 265922 System time = 09/02/2019 21:04:23, Simulator time = 11:31:05 (17:31Z) 265922 FLT path = "C:\Users\fryau\Documents\Prepar3D v4 Files\" [Continuation log requested by user] Running inside Prepar3D v4 on Windows 10 Module base=7FFC4E7E0000 284281 LUA.0: beginning "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua" 284281 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:2 284281 LUA.0: Global: ipcPARAM = 1 284297 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:3 284297 LUA.0: Global: battery = 1 284297 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:4 284313 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:10 284328 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:11 284328 LUA.0: Global: generator = 0 284328 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:14 284360 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:21 284360 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:22 284360 LUA.0: Global: IAS = 0.010000006788308 284391 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:23 284453 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:26 284453 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:27 284453 LUA.0: Global: VSI = -4.4963158860615e-05 284485 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:28 284547 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:31 284547 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:32 284547 LUA.0: Global: TurnFlag = 1 284547 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:33 284625 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:36 284625 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:37 284625 LUA.0: Global: Fuel_L = 12.731631501994 284656 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:38 284719 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:41 284719 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:42 284719 LUA.0: Global: Fuel_R = 18.753874975092 284719 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:43 284781 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:46 284781 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:47 284781 LUA.0: Global: EGT = 506.74032891438 284781 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:48 284860 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:21 284860 LUA.0: ...m Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua:22 (...) 1633297 LUA.1: beginning "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\RPM.lua" 1633297 *** LUA Error: C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\RPM.lua:7: unexpected symbol near 'ï' There is an error effectively. "unexpected symbol near 'ï' This is my script, I searched a lot but I do not see where there can be an error ... especially since this script was working this morning ... function RPM (Lvarname,value) ipc.writeUW(0x66C0,value) end RPM ("Eng1_RPM",ipc.readLvar("Eng1_RPM")) event.Lvar("Eng1_RPM",100,"RPM") Thank you for your help, Aurelien
  5. Thanks Pete, So, yes I have found the Log Lvar.lua, anyway I have define ctrl+F2 for log lua log Lvar and ctrl+F3 for lua kill all to stop the log. When I use these, I have this file: (I cut the middle, this is all the Lvar as you know, thas why I did not put it just before. I put the begining and the end, unless you want it entirely?) FSUIPC5 Key is provided WIDEFS7 not user registered, or expired 0 System time = 09/02/2019 19:14:12 0 FLT path = "C:\Users\fryau\Documents\Prepar3D v4 Files\" 16 Using DialogMode 16 FS path = "C:\Program Files\Lockheed Martin\Prepar3D v4\" 110 ---------------------- Joystick Device Scan ----------------------- 110 Product= T.16000M 110 Manufacturer= Thrustmaster 110 Vendor=044F, Product=B10A (Version 5.0) 125 GUIDs returned for product: VID_044F&PID_B10A: 125 GUID= {A07D8400-0B8F-11E9-8001-444553540000} 125 Details: Btns=16, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R255,U0,V0,X16383,Y16383,Z255 125 ------------------------------------------------------------------- 125 Device acquired for use: 125 Joystick ID = 0 (Registry okay) 125 0=T.16000M 125 0.GUID={A07D8400-0B8F-11E9-8001-444553540000} 125 ------------------------------------------------------------------- 157 LogOptions=00000000 00000001 157 ------------------------------------------------------------------- 157 SimConnect_Open succeeded: waiting to check version okay 157 Opened separate AI Traffic client okay 157 ### PDKmodeHelper callback registered! 1735 Running in "Lockheed Martin® Prepar3D® v4", Version: 4.3.29.25520 (SimConnect: 4.3.0.0) 1735 Initialising SimConnect data requests now 1735 FSUIPC Menu entry added 1750 ... Using Prepar3D with Academic License 1766 C:\Users\fryau\AppData\Local\Lockheed Martin\Prepar3D v4\Prepar3D_Default.fxml 1766 C:\Program Files\Lockheed Martin\Prepar3D v4\SimObjects\Airplanes\IRIS Raptor Driver\Raptor.air 17657 C:\Users\fryau\Documents\Prepar3D v4 Add-ons\A2A\SimObjects\Airplanes\A2A_C172\C172.air 17672 ### The user object is 'A2A C172R F-GOAP' 17672 ### Mode is NORMAL 17954 ### Mode: PAUSE on 46329 Loading Complete ... 46375 ### Mode is NORMAL 47594 Aircraft loaded: running normally now ... 47641 User Aircraft ID 1 supplied, now being used 48282 System time = 09/02/2019 19:15:00, Simulator time = 11:30:28 (17:30Z) 48282 Aircraft="A2A C172R F-GOAP" 54266 -------------------- Starting everything now ---------------------- 55469 Advanced Weather Interface Enabled 72313 LUA.0: L:vis_WingLeft_TieDown=0 72313 LUA.0: L:vis_WingRight_TieDown=0 72313 LUA.0: L:SteamAmount=0 72313 LUA.0: L:C172Manual=0 72329 LUA.0: L:FloodLight2Switch=0 72329 LUA.0: L:FloodLight1Switch=0 72329 LUA.0: L:GpsOnSwitch=0 72329 LUA.0: L:AvionicsConfiguration=0 72329 LUA.0: L:AvionicsElecPower=0 72329 LUA.0: L:RXP.GNS.WAAS.430.1.POWER=0 72329 LUA.0: L:RXP.GNS.WAAS.530.1.POWER=0 72329 LUA.0: L:kma26Nav1Switch=0 72344 LUA.0: L:kma26Nav2Switch=0 72344 LUA.0: L:kma26MkrSwitch=0 72344 LUA.0: L:kma26DmeSwitch=0 72344 LUA.0: L:kma26AdfSwitch=0 72344 LUA.0: L:ElecPower=0 72344 LUA.0: L:Ballpen1vis=1 72344 LUA.0: L:Ballpen2vis=1 72344 LUA.0: L:Headphones=0 72360 LUA.0: L:Steam2Amount=0 72360 LUA.0: L:PedestalLightSwitch=0 72360 LUA.0: L:PanelLightSwitch=0 72360 LUA.0: L:Units=0 (...) 110657 LUA.0: L:LeftBrakePressureGauge=0.00054656377354295 110688 LUA.0: L:BrakesLeft=0.00054656377354295 110719 LUA.0: L:RightBrakePressureGauge=0.00027281664088725 110750 LUA.0: L:BrakesRight=0.00027281664088725 110782 LUA.0: L:Eng1_Boost=15.949740466501 110829 LUA.0: L:SuctionPressure=2.3864507716101 110860 LUA.0: L:Eng1_RPMGauge=610.1352041422 110891 LUA.0: L:Eng1_FuelPressureGauge=11.926985450414 110922 LUA.0: L:Eng1_FuelPressure=11.926985450414 110954 LUA.0: L:InclinometerBall=-0.0001004292963701 110985 LUA.0: L:SystemCondSelect=7 111032 LUA.0: L:SystemCondValue=0 111063 LUA.0: L:Eng1_Hydraulic_Pump_1_cond=0.94995082692357 111094 LUA.0: L:Eng1_OilPressureGauge=61.499939421486 111672 LUA: "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\log lvars.lua": killed 112110 LUA: "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua": killed On this, the only thing that I notice that intrigues me, it's only 111672 LUA: "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\log lvars.lua": killed 112110 LUA: "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\C172.lua": killed while my script with the event.Lvar() function is on a folder name "RPM.lua" in module folder, as C172.Lua and while my FSUIPC.ini folder has [LuaFiles] 1=C172 2=log lvars 3=RPM all rest off the lua log file seems normal...
  6. I understand that my first script was all wrong. That's why I had search to correct this, and I have find a good script few minutes later. Excuse me to had put my wrong script directly before to find an answer... I don't understand what you mean with the lvar monitoring pulg-in? If your question is: does Lvar "L:VerticalSpeed" is the good Lvar for vertical speed, yes it is. Anyway, it work with my first script "while 1 do ... ipc.readLvar...end" This script woked perfectly before, but now, it does not work anymore... 😣 function RPM (Lvarname,value) ipc.writeUW(0x66C0,value) end RPM ("Eng1_RPM",ipc.readLvar("Eng1_RPM")) event.Lvar("Eng1_RPM",100,"RPM") I had check tho Log, but there is no errors visibly... ********* FSUIPC5, Version 5.15 (27th November 2018) by Pete Dowson ********* Running inside Prepar3D v4 Module base=7FFC52C50000 Windows 10 Home 64 Bit reported as Build 17134, Release ID: 1803 (OS 10.0) Prepar3D.exe version = 4.3.29.25520 Reading options from "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\FSUIPC5.ini" Checking the Registrations now ... User Name="Aurelien ..." User Addr="aurelien@..." FSUIPC5 Key is provided WIDEFS7 not user registered, or expired 16 System time = 09/02/2019 16:50:15 16 FLT path = "C:\Users\fryau\Documents\Prepar3D v4 Files\" 16 Using DialogMode 16 FS path = "C:\Program Files\Lockheed Martin\Prepar3D v4\" 109 ---------------------- Joystick Device Scan ----------------------- 125 Product= T.16000M 125 Manufacturer= Thrustmaster 125 Vendor=044F, Product=B10A (Version 5.0) 156 GUIDs returned for product: VID_044F&PID_B10A: 156 GUID= {A07D8400-0B8F-11E9-8001-444553540000} 156 Details: Btns=16, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R255,U0,V0,X16383,Y16383,Z255 156 ------------------------------------------------------------------- 172 Device acquired for use: 172 Joystick ID = 0 (Registry okay) 172 0=T.16000M 172 0.GUID={A07D8400-0B8F-11E9-8001-444553540000} 172 ------------------------------------------------------------------- 188 LogOptions=00000000 00000001 188 ------------------------------------------------------------------- 188 SimConnect_Open succeeded: waiting to check version okay 188 Opened separate AI Traffic client okay 188 ### PDKmodeHelper callback registered! 2516 Running in "Lockheed Martin® Prepar3D® v4", Version: 4.3.29.25520 (SimConnect: 4.3.0.0) 2516 Initialising SimConnect data requests now 2516 FSUIPC Menu entry added 2516 ... Using Prepar3D with Academic License 2531 C:\Users\fryau\AppData\Local\Lockheed Martin\Prepar3D v4\Prepar3D_Default.fxml 2531 C:\Program Files\Lockheed Martin\Prepar3D v4\SimObjects\Airplanes\IRIS Raptor Driver\Raptor.air 12594 C:\Users\fryau\Documents\Prepar3D v4 Add-ons\A2A\SimObjects\Airplanes\A2A_C172\C172.air 12625 ### The user object is 'A2A C172R F-GOAP' 12625 ### Mode is NORMAL 12938 ### Mode: PAUSE on 41891 Loading Complete ... 41922 ### Mode is NORMAL 42969 User Aircraft ID 1 supplied, now being used 42969 Aircraft loaded: running normally now ... 43859 System time = 09/02/2019 16:50:59, Simulator time = 16:50:20 (22:50Z) 43859 Aircraft="A2A C172R F-GOAP" 49859 -------------------- Starting everything now ----------------------
  7. I still have a problem... The code is ok, and work great for RPM. So I put a second Lvar, on the same script: -- definition des fonctions function RPM (Lvarname,value) ipc.writeUW(0x66C0,value) end function VSI (Lvarname,value) ipc.writeSW(0x66C3,value) end -- lecture des Lvar RPM ("L:Eng1_RPM",ipc.readLvar("L:Eng1_RPM")) VSI ("L:VerticalSpeed",ipc.readLvar("L:VerticalSpeed")) -- surveillance des changements de valeur event.Lvar("L:Eng1_RPM",100,"RPM") event.Lvar("L:VerticalSpeed",100,"VSI") but there is no value for vertical speed... I tried to do one separate script for vertical speed, but it doesn't work too... it's weird. Do you have any idea? Thank you Aurelien
  8. It's OK, I finded the good script and removed everything before. This is my script; and it's loaded as soon as RPM value change! thanks! function RPM (Lvarname,value) ipc.writeUW(0x66C0,value) end RPM ("Eng1_RPM",ipc.readLvar("Eng1_RPM")) event.Lvar("Eng1_RPM",100,"RPM") 😉
  9. Sorry Pete but I dont' understand; I made it very clear the Lvar between the () after "event.Lvar". If I understand correctly, it is not enough to just replace ipc.readLvar by event.Lvar? I tried with "function", with thirs code, but it doesn't work function(Eng1_RPM, value) event.Lvar("L:Eng1_RPM", 100, Eng1_RPM) ipc.writeUW(0x66c0, Eng1_RPM) end
  10. Hi John, I tried to use the library "event.Lvar()" but there is nothing when Lvar change, even if I switch some thing like battery. I tried with this code: while 1 do RPM = event.Lvar("L:Eng1_RPM") ipc.writeUW(0x66c1, RPM) ipc.sleep(100) IAS = event.Lvar("L:AirspeedIndicatedNeedle") ipc.writeUB(0x66c0, IAS) ipc.sleep(100) end thank you, Regards Aurelien
  11. Thank you, I had just found the mistake! I had the idea to be one as you suggested, and it works! ... Now I will look with "event.Lvar ()" function Regards, Aurelien
  12. Hi Pete, I have progressed! First, I modified the script, for IAS, 8 bit, so ipc.writeUB, on offset 66c0. Test: all right, it works. Next, I added the script for RPM, 16 bit, so ipc.writeUW, on offset 66c1; Test: negatif. Always ok for the IAS, but no value receive for the RPM. This is the script: -- test battery battery = ipc.readUB(0x3340) if battery > 0 then ipc.writeLvar("L:Battery1Switch",1) else ipc.writeLvar("L:Battery1Switch",0) end -- test IAS while 1 do IAS = ipc.readLvar("L:AirspeedIndicatedNeedle") ipc.writeUB(0x66c0, IAS) ipc.sleep(100) end -- test RPM while 1 do RPM = ipc.readLvar("L:Eng1_RPM") ipc.writeUW(0x66c1, RPM) ipc.sleep(100) end So I decided to switch the positions of these scripts: and that is the problem!!: now, I haved value for RPM on 66c1, but no for IAS on 66c0! the script: -- test battery battery = ipc.readUB(0x3340) if battery > 0 then ipc.writeLvar("L:Battery1Switch",1) else ipc.writeLvar("L:Battery1Switch",0) end -- test RPM while 1 do RPM = ipc.readLvar("L:Eng1_RPM") ipc.writeUW(0x66c1, RPM) ipc.sleep(100) end -- test IAS while 1 do IAS = ipc.readLvar("L:AirspeedIndicatedNeedle") ipc.writeUB(0x66c0, IAS) ipc.sleep(100) end So I have understood that only the first script is reading in the script! After, I have tried to do 2 script .lua: on first for battery (3340) and IAS (66c0) on second for alternator (3344) and RPM (66c1) => and now, it works for the two gauges i same time! Because there is on 2 differents script! Do you know if it's possible to write theses script on the same .lua text? Maybe I forgot something between the two script? Thank you for your help, Aurelien
  13. Oh sorry... I mixed every thing between decimal and binary!!... Yes you are right, speed value is rounded. Mobiflight use the rounded value, so for the speed, 0 to ~ 200 knots wich gives in decimal 0 to 11001000 so 8 bit, unsigned. So if I use the offset 66c0, for the airspeed gauge, wich use 8 bit=1 byte, the next free offset should be... 66c0 + 1 byte = 66c1= the next free offset wich can be use. That's all right? Thank you, Aurelien
  14. Thank you Pete. I start to see more clearly, I started again from the beginning today. I used the offsets you told me. So, first, I checked the Lvar list in real time. This is a part of it: 3528031 LUA.1: L:Eng1_RPM=1616.0072558023 For the RPM, we have 14 figures, only positive. So, logically, it's on a 16bit, and usigned, so it will be "writeUW" in the script. I tried with this code, on offset 66c0. And it's ok!!🤩 while 1 do RPM = ipc.readLvar("L:Eng1_RPM") ipc.writeUW(0x66c0, RPM) ipc.sleep(100) end after, I tried, like yesterday with the IAS gauge. i checked the Lvar value: 3524953 LUA.1: L:AirspeedIndicatedNeedle=86.544639078253 Idem, for the airspeed, we have 14 figures, always positive. So, logically => 16bit, unisgned. So I tried with offset 66c8, while 1 do IAS = ipc.readLvar("L:AirspeedIndicatedNeedle") ipc.writeUW(0x66c8, IAS) ipc.sleep(100) end But it doesn't work... After, I tried with other offset (66C1, 66C2, 66FF,...) always same thing. But, to bsure that my script is good, I tried to delete the RPM script in offset 66c0, to put the airspeed in offset 66c0, and... that's work!! So my problem now is only from the offset. I'm not sure I understand everything about offset... Could you give me a little help? Thank a lot, best regard
  15. Hi every body, I'm working to interface the A2A cessna to make a home cockpit. For the moment, I would like to see what can I do only with simple arduino and mobiflight. And I have already my first results! 😃 I have interfaced some switches, like battery, alternateur, ... with simple Lua script. For example, this is my script wich I can drive the battery switch: battery = ipc.readUB(0x3340) if battery > 0 then ipc.writeLvar("L:Battery1Switch",1) else ipc.writeLvar("L:Battery1Switch",0) end It works greatly! Today, I succeeded to drive my first gauge!! 😅 For the RPM, with motor stepper, with Lvar and Lua script! and this script... while 1 do Eng1_RPM = ipc.readLvar("L:Eng1_RPM") ipc.writeSW(0x66c8, Eng1_RPM) ipc.sleep(100) end So, after that, I thought that it would be simple to drive other gauge, on other free offset. But no result for the moment... I try to drive the IAS gauge, with this script, but it doesn't work... I've tried on many different offset... while 1 do IAS = ipc.readLvar("L:AirspeedIndicatedNeedle") ipc.writeSD(0x9200, IAS) ipc.sleep(100) end Could someone have an idea? Best regard
×

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.