NicHer Posted September 2 Report Posted September 2 Hello I am using project magenta. I realise that the central EICAS engine oil indicator is reading zero. I believe this is an error as the engine operates normally. I would like to 'fill' the engine oil tank by writing a value to the simulator, perhaps via FSUIPC. I am happy for the tank to be full all the time, so perhaps a sending of the value once per switch on of the simulator? 08D0 4 Engine 1 Oil Quantity: 16384 = 100% On FS2000 FSUIPC usually has to derive this from a leakage value as it isn’t provided directly. 0968 4 Engine 2 Oil Quantity: 16384 = 100% On FS2000 FSUIPC usually has to derive this from a leakage value as it isn’t provided directly. Could you advise me of the best way to proceed? Ie. write a value (presumably 16384 to the offset above? Thank you for your support.
John Dowson Posted September 3 Report Posted September 3 10 hours ago, NicHer said: I realise that the central EICAS engine oil indicator is reading zero. I believe this is an error as the engine operates normally. Which version of FSUIPC and which FS are you using? I am not sure that they are the correct offsets to use. Try logging the values first, using FSUIPC's offset logging facilities. Also try logging the oil pressure offsets, 08BA and 0952. You may find they already hold the correct values. 10 hours ago, NicHer said: so perhaps a sending of the value once per switch on of the simulator? You would want to do this when the aircraft is loaded, not when the sim is started. To do this, you can use a script called ipcReady.lua, which is ran automatically when an aircraft is loaded and ready-to-fly. To write to offsets 08D0 / 0968, they are 4 bytes so you would use the function ipc.writeUD (or maybe ipc.writeSD), e,g, ipc.writeUD(0x08D0, 16384) ipc.writeUD(0x0968, 16384) As offsets 08BA and 0952 are 2 bytes, you would use ipc.writeUW: ipc.writeUW(0x08BA, 16384) ipc.writeUW(0x0952, 16384) You can try this But as you are using Project Magenta, it may be using its own offsets anyway. You should ask about this on PM support. John
NicHer Posted September 3 Author Report Posted September 3 Thank you . The offsets above are from PM. i do not know how to create a lua or where to place it. I guess I will reread the manual and take more time to digest it: thank you for your quick reply. cheers nick
John Dowson Posted September 3 Report Posted September 3 (edited) 11 minutes ago, NicHer said: The offsets above are from PM. No - they are standard FSUIPC offsets (maybe also documented in PM). PM specific offsets are in the range 04E0-0573 and also maybe in 5200-5FFF. 11 minutes ago, NicHer said: i do not know how to create a lua or where to place it. I guess I will reread the manual and take more time to digest it: By default, lua scripts go in your FSUIPC installation folder. Just create a file called ipcready.lua in your FSUIPC installation folder and add those ipc calls I gave you. But first please check that they are not already correct by logging the values of those offsets. John Edited September 3 by John Dowson further info added
NicHer Posted September 3 Author Report Posted September 3 Thank you . It works perfectly! Fsuipc is wonderful. As I have you, I would like to ask for your guidance in connecting two offsets. The MIP light test switch just illuminates the MIP lights. I’d like for the overhead to illuminate as well. If I could find a way to monitor the manipulation of the switch via its change on its offset 0x560D bit .5 (cpflight light test) and activate offset 0x 560D .0 (master light test) that would be fantastic. Thank you
John Dowson Posted Thursday at 08:38 AM Report Posted Thursday at 08:38 AM 12 hours ago, NicHer said: As I have you, I would like to ask for your guidance in connecting two offsets. The MIP light test switch just illuminates the MIP lights. I’d like for the overhead to illuminate as well. As this is a separate issue, you should really create a new topic... 12 hours ago, NicHer said: If I could find a way to monitor the manipulation of the switch via its change on its offset 0x560D bit .5 (cpflight light test) and activate offset 0x 560D .0 (master light test) that would be fantastic. Create another lua script, call it MIPSwitch.lua and add the following: funtion MIPSwitchMonitor(offset, value) -- bit 5 has changed: change bit 0 ipc.togglebitsUB(0x560D, 1) end event.offsetmask(0x560D, 32,"UB", "MIPSwitchMonitor") -- bit 5 mask is 2^5 = 32 That script will change/toggle bit 0 when bit 5 is changed. However, it won't keep them in sync, so if bit 0 is changed on its own, then they will toggle out-of-sync. You can update the script if you want them always synced. The script must be running - the best way to do this is to have it auto-started, by adding the following to your FSUIPC4.ini file )still don't know what version of FSUIPC you are using, but presume its 4!): [Auto] 1=Lua MIPSwitch John
John Dowson Posted Thursday at 09:26 AM Report Posted Thursday at 09:26 AM Note that if the data held in offset 0x560D is larger than 1 byte, i.e. a word (2-bytes) or a double-word (4 bytes), you should change the size in the offsetmask function (to "UW" or "UD") and use the appropriate togglebits function (ipc.togglebitsUW or ipc.togglebitsUD).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now