Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi,

I've recently purchased a stream controller (Soomfon) and it's working beautifully with the Fenix L:Var/Lua file in FSUIPC - I assign a keyboard key and it binds to that function - then use the box to call on that key combo and absolutely everything works perfectly (overhead panel buttons, FCU, Lights, etc) but the APU start button does not seem to work after following normal procedures - APU Master SW - APU start - APU bleed. The master switch works and so does the bleed - but not the APU start - any ideas why?

My Lua file is the following:

-- Toggle APU Start Button
local val = ipc.readLvar("S_OH_ELEC_APU_START")

if val == 0 then
    ipc.writeLvar("S_OH_ELEC_APU_START", 1)
else
    ipc.writeLvar("S_OH_ELEC_APU_START", 0)
end
 

Posted

Does the lvar change values? Ifthe script is sunning as expected and the lvar is changing values, then you need something more than just to set that lvar.
Why not try the presets instead: APU Start Button Push and APU Start Button Release

Use logging to see if the script is running and the lvar is being updated: set logging for Lua Plugins and WAPI debug level logging.

Posted
16 minutes ago, Jacques Balayla said:

Do you have the APU Start Button Push and APU Start Button Release  l:var functions for the fenix?

They are MF presets, and there is also FNX320_APU_START_SWITCH.
You can assign to presets directly (check the select fir Preset checkbox), or in lua you can use ipc.execPreset function.

I don't have the fenix to check these.

John

 

Posted

Btw, the calc code for FNX320_APU_START_SWITCH is:
    (L:S_OH_ELEC_APU_START) 2 +  (>L:S_OH_ELEC_APU_START)

i.e. it is incrementing the lvar by 2, not 1. So maybe try:

- Toggle APU Start Button
local val = ipc.readLvar("S_OH_ELEC_APU_START")

if val == 0 then
    ipc.writeLvar("S_OH_ELEC_APU_START", 2)
else
    ipc.writeLvar("S_OH_ELEC_APU_START", 0)
end

The calc code for the press/release presets looks rather strange to me, as it seems to be sending two values to the lvar, which I didn't think possible:
    push: 1 (L:S_OH_ELEC_APU_START) ++ (>L:S_OH_ELEC_APU_START)
    release: 0 (L:S_OH_ELEC_APU_START) ++ (>L:S_OH_ELEC_APU_START)
    
If the presets are not working, you can ask about this on the MF support discord server (MSFS2020 channel).

John

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.