Jump to content
The simFlight Network Forums

Recommended Posts

Posted (edited)

*** Moved to FSUIPC7 support sub-forum ***

Hello, i just need a little Help with the Asobo B748-8I in MSFS2024.
I try to switch the Fuel Pumps on in a lua Script. I found out, that the Cntrl 67192 is the right one.
When turning i.E. the FWD OVRD Pump on/off with the Mouse in the Cockpit, the log states this:
   775187 *** EVENT: Cntrl= 67192 (0x00010678), Param1= 7 (0x00000007), Param2= 1 (0x00000001) FUELSYSTEM_PUMP_SET
   775187 InputEvent received: FUEL_PUMP_FWD_2=1.000000 (param=';FLOAT64')
   775203 InputEvent received: FUEL_PUMP_FWD_2=1.000000 (param=';FLOAT64')
   776109 *** EVENT: Cntrl= 67192 (0x00010678), Param1= 7 (0x00000007), Param2= 0 (0x00000000) FUELSYSTEM_PUMP_SET
   776109 InputEvent received: FUEL_PUMP_FWD_2=0.000000 (param=';FLOAT64')

In my Lua File, i issue this Command:
ipc.control(67192, 7, 1)
But nothing happens in the Cockpit.
This is also when given this Command:
ipc.control(67192, 7)

Could anybody please help? Thanks a lot in Advance.

Greets, Joachim

Edited by John Dowson
Moved to FSUIPC7 support forum
Posted
14 hours ago, Airbuspilot said:

In my Lua File, i issue this Command:
ipc.control(67192, 7, 1)
But nothing happens in the Cockpit.

Why would you expect that to work? Please consult the documentation - ipc.control only accepts 1 parameter for the control:

Quote
ipc.control(n) ipc.control(n, param)

Sends the FS or FSUIPC control ‘n’, with the optional parameter (assumed 0 if omitted).

FS controls are listed in a List of ...” controls document provided separately. FSUIPC added control numbers are listed in the Advanced User’s guide.

I will look into allowing two parameters for this, and once this is done the documentation will be updated to reflect this.
Please don't guess on lua functions and parameters - consult the documentation. I provide that for a reason.

The only way to yse a control with multiple parameters at the moment is using calculator code, and in lua you can use the ipc.execCalcCode function.
Here's the MSFS documentation on this (from https://docs.flightsimulator.com/flighting/html/Programming_Tools/SimVars/Simulation_Variables.htm#SimVars😞

Quote

Keys

Key events permit you to change the state of a component or other aspect of the simulation based on some form of input. When checking for a key event, you would use the following RPN format:

[0] (>K:[key_event_name])
[1] [0] (>K:2:[key_event_name])

There are two formats showing for accessing key events because many of them require not just one but two parameters, and so the formatting above shows how this is achieved. Below are two "real world" examples, one with a single parameter and the other with 2 parameters:

1 (>K:TOGGLE_EXTERNAL_POWER)
50 1 (>K:2:PANEL_LIGHTS_POWER_SETTING_SET)

However, the log extract you posted shows the Input Event FUEL_PUMP_FWD_2 is used. Try assigning to that first instead.

There may also be some B-vars (also called input events) available that can be used via calc. code (not all b-vars are available/mapped as Input Events). The following tutorial shows how to discover and use B-vars, although once discovered you would use to define calc. code for a preset (and don't have to use MobiFlight!): https://www.badcasserole.com/uncovering-input-events-using-the-msfs2024-model-behavior-dialog/

I may take a look at the 747 in MSFS2024 later to see how it works, but if you find anything before that then please update.

John

Posted

Hello John,
thanks for your attempt to help me, solve my Problem.
You can be sure, that i have been looking into the Documentations before i open a Post in here.
But neither the Controls nor the execCalcCode Command helps.

I have tried several Notations in the execCalcCode Command. Without any Efforts.

Finally, i will look into the badcasserole.com
If i am still not able to solve the Problem, i need to give up.

Again thanks for trying to help.

Joachim

Posted
11 minutes ago, Airbuspilot said:

You can be sure, that i have been looking into the Documentations before i open a Post in here.

Then it should have been obvious that ipc.control does not (yet) support more than one parameter to the control.

12 minutes ago, Airbuspilot said:

I have tried several Notations in the execCalcCode Command. Without any Efforts.

There is only one way: "1 7 (>K:2:FUELSYSTEM_PUMP_SET)"

Did you try assigning to the Input Event?

I will take a look later (or tomorrow), if/when I have time...

John

Posted
3 hours ago, Airbuspilot said:

badcasserole.com brought the Solution.

Which is? Please can you post the solution for others that come across this post. It is quite annoying when people find a solution to an issue they have posted about but don't share the solution....

Posted (edited)

@Airbuspilot As well as posting your solution, could you let me know where the fuel pump switches are in the B747-8i - I would like to check a few thinks with 2 params for a control and check the input events, but I can't seem to find the fuel pump switches...

Later:

The fuel pump switches in the overhead seem to work using input events - just assign to the Input Event  FUEL_PUMP_FWD_2 with a parameter of 1 for on and 0 for off. No need to use presets.

In fact, there are a lot of Input Events for this aircraft....

Edited by John Dowson
Later added
Posted
21 hours ago, John Dowson said:

@Airbuspilot As well as posting your solution, could you let me know where the fuel pump switches are in the B747-8i - I would like to check a few thinks with 2 params for a control and check the input events, but I can't seem to find the fuel pump switches...

Later:

The fuel pump switches in the overhead seem to work using input events - just assign to the Input Event  FUEL_PUMP_FWD_2 with a parameter of 1 for on and 0 for off. No need to use presets.

In fact, there are a lot of Input Events for this aircraft....

Sorry, i forgot to post my Solution. There are really much Input Events in this A/C.
ipc.execCalcCode("1 (>B:FUEL_PUMP_MAIN_FWD_1_Set)")
This works for every Input Event. All you need, is to figure out the Variable Name. 

Posted
1 hour ago, Airbuspilot said:

Sorry, i forgot to post my Solution. There are really much Input Events in this A/C.
ipc.execCalcCode("1 (>B:FUEL_PUMP_MAIN_FWD_1_Set)")
This works for every Input Event. All you need, is to figure out the Variable Name. 

Thanks.

Note its probably easier just to assign directly to the Input Event itself. In the button assignments tab, select for Input Events and then select the 'FUEL_PUMP_MAIN_FWD_1' input event from the drop-down - note the actual Input Event names differ from the B-vars. This saves you having to figure out the B-var name,

You can also see the available Input Events using Log->List Input Events, and you can see what input event is being used by setting Log->Input Events, opening the logging console (Log->Open Console) and operate the switch/button/dial in the VC and see what is logged.

You can also add Input Events to offsets and trigger them by updating the offset. This is useful when you need to know the current value of an Input Event, or if you wan to increment/decrement an Input Event. I recently showed how to do this in the following post (just FYI):
    

Cheers,

John

Posted
26 minutes ago, Airbuspilot said:

I am not so familiar with the Log-Facilities in FSUIPC.

You should look into them, its not difficult. MSFS is a very different beast that FSX/P3D, and there are various different options for assignment (not just FS controls and the occasional lvar). FSUIPC's logging helps you determine what to use, and is a lot easier and quicker (in most cases, IMHO) than using the MSFS debugging tools, which I only use rarely as a last resort.

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.