John Dowson Posted June 6, 2024 Report Posted June 6, 2024 On 6/6/2024 at 4:07 PM, DaveSCUSA said: There are switchs that have eluded me. They are both the fuel valves in the VC located on the trottle handles. Expand Yes, those are the ones that I couldn't find anything for, as I said: On 4/11/2024 at 6:12 PM, John Dowson said: The only difficulty I am having at the moment is for the fuel cut-off triggers Expand and later: On 6/5/2024 at 2:48 PM, John Dowson said: the last time I looked at this aircraft I could not find anything to control the fuel cut-off triggers (bottom of throttle). I can take another look, when time permits Expand On 6/6/2024 at 4:07 PM, DaveSCUSA said: Are there any other methods to discover the items that drive these fuel events? Expand As there is nothing obvious, the next step would be to inspect the xml code to see how that works. I will take another look, but not until the weekend. John
DaveSCUSA Posted June 6, 2024 Author Report Posted June 6, 2024 On 6/6/2024 at 4:19 PM, John Dowson said: Yes, those are the ones that I couldn't find anything for, as I said: and later: As there is nothing obvious, the next step would be to inspect the xml code to see how that works. I will take another look, but not until the weekend. John Expand Thank you.
DaveSCUSA Posted June 6, 2024 Author Report Posted June 6, 2024 Thanks, I found 2 LVars in the C510_interior.xml. The names are switch_fuel_left and right. I assigned each to offsets 66C6 and 66C7 and entered them in the offset log. Started the C510, exercised the fuel valves and didn't show any activity except the toggle events.
John Dowson Posted June 6, 2024 Report Posted June 6, 2024 On 6/6/2024 at 5:20 PM, DaveSCUSA said: I assigned each to offsets 66C6 and 66C7 and entered them in the offset log. Expand What do you mean by 'offset log'? There is no such thing. There is the myOffsets.txt file, which is not a log, but a list of simvars (or a-type variables) to add to offsets. You may be able to add lvars to this, as lvars are now supported by the SimConnect SDK, but I haven't tested (or documented) this yet so I am not sure. To add lvars to offsets, you should use the [LvarOffsets] section of the ini file (see Advanced User guide). On 6/6/2024 at 5:20 PM, DaveSCUSA said: Started the C510, exercised the fuel valves and didn't show any activity except the toggle events. Expand Sorry, what does this mean? Do those lvars work to control the fuel valves or not? Btw, it is a good idea to test lvars before using them, using the provided facilities (e.g. Add-ons->WASM->Set Lvar...,).
DaveSCUSA Posted June 6, 2024 Author Report Posted June 6, 2024 On 6/6/2024 at 5:52 PM, John Dowson said: What do you mean by 'offset log'? There is no such thing. There is the myOffsets.txt file, which is not a log, but a list of simvars (or a-type variables) to add to offsets. Expand On 6/6/2024 at 5:52 PM, John Dowson said: Sorry, what does this mean? Do those lvars work to control the fuel valves or not? Expand Not sure what your terminology is for the logging function. In the Log drop down in the UI there is an entry for offsets. Upon opening the window, there are four boxes to enter offsets. I used two spare offsets to attach L:switch_fuel_left and L:switch_fuel_right found in the C510_interior.xml file. Both offsets x66C6 and x66C7 showed in the log as 0 value at flight initialization. When the fuel valve switches were turned on, then off in the cockpit at startup, the only entry shown in the log are two events - TOGGLE_FUEL_VALVE_ENG_1 and TOGGLE_FUEL_VALVE_ENG2. No Input Event is displayed. There are no additional offset log entries. A sample of code from the C510_interior.xml file is <LEFT_SINGLE_CODE>(L:switch_fuel_left, bool) ! (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1)</LEFT_SINGLE_CODE>
DaveSCUSA Posted June 7, 2024 Author Report Posted June 7, 2024 Thanks for all your input, I have it working. M_LH_Fuel_On#0 (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) 1 (>L:C510L_Fuel_1, Enum) M_RH_Fuel_On#0 (>L:switch_fuel_right, bool) (>K:TOGGLE_FUEL_VALVE_ENG2) 1 (>L:C510L_Fuel_2, Enum) M_LH_Fuel_Off#1 (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) 0 (>L:C510L_Fuel_1, Enum) M_RH_Fuel_Off#1 (>L:switch_fuel_right bool) (>K:TOGGLE_FUEL_VALVE_ENG2) 0 (>L:C510L_Fuel_2, Enum)
John Dowson Posted June 7, 2024 Report Posted June 7, 2024 On 6/6/2024 at 8:08 PM, DaveSCUSA said: Not sure what your terminology is for the logging function. In the Log drop down in the UI there is an entry for offsets. Upon opening the window, there are four boxes to enter offsets. Expand There are no specific logging functions for lvars. To see what lvars are available, and what values they currently have, just list them (Add-ons -> WASM -> List Lvars). On 6/6/2024 at 8:08 PM, DaveSCUSA said: Both offsets x66C6 and x66C7 showed in the log as 0 value at flight initialization. When the fuel valve switches were turned on, then off in the cockpit at startup, the only entry shown in the log are two events - TOGGLE_FUEL_VALVE_ENG_1 and TOGGLE_FUEL_VALVE_ENG2. No Input Event is displayed. There are no additional offset log entries. Expand Did you send the offsets to the log file? As your next post indicates that these lvars work, I would expect there values to change. Try listing them. On 6/6/2024 at 8:08 PM, DaveSCUSA said: A sample of code from the C510_interior.xml file is <LEFT_SINGLE_CODE>(L:switch_fuel_left, bool) ! (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1)</LEFT_SINGLE_CODE> Expand So that toggles an lvar value and triggers and event. On 6/7/2024 at 1:15 AM, DaveSCUSA said: Thanks for all your input, I have it working. M_LH_Fuel_On#0 (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) 1 (>L:C510L_Fuel_1, Enum) M_RH_Fuel_On#0 (>L:switch_fuel_right, bool) (>K:TOGGLE_FUEL_VALVE_ENG2) 1 (>L:C510L_Fuel_2, Enum) M_LH_Fuel_Off#1 (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) 0 (>L:C510L_Fuel_1, Enum) M_RH_Fuel_Off#1 (>L:switch_fuel_right bool) (>K:TOGGLE_FUEL_VALVE_ENG2) 0 (>L:C510L_Fuel_2, Enum) Expand I don't understand that - there are no such lvars as C510L_Fuel_1 or C510L_Fuel_2, so those presets will create those lvars and set the value - is that what you want? Otherwise, simplify to the following, which matches the gauge xml code: M_LH_Fuel_On#0 (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) M_RH_Fuel_On#0 (>L:switch_fuel_right, bool) (>K:TOGGLE_FUEL_VALVE_ENG2) M_LH_Fuel_Off#1 (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) M_RH_Fuel_Off#1 (>L:switch_fuel_right bool) (>K:TOGGLE_FUEL_VALVE_ENG2) John
John Dowson Posted June 7, 2024 Report Posted June 7, 2024 Note also that separate on/off presets are good for assigning to a switch or sticky button, but for a standard button or key assignment, you may be better off using toggle presets: M_LH_Fuel_Toggle#(L:switch_fuel_left, bool) ! (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) M_RH_Fuel_Toggle#(L:switch_fuel_right, bool) ! (>L:switch_fuel_right, bool) (>K:TOGGLE_FUEL_VALVE_ENG2) John
DaveSCUSA Posted June 13, 2024 Author Report Posted June 13, 2024 On 6/7/2024 at 9:32 AM, John Dowson said: On 6/7/2024 at 9:32 AM, John Dowson said: Note also that separate on/off presets are good for assigning to a switch or sticky button, but for a standard button or key assignment, you may be better off using toggle presets: M_LH_Fuel_Toggle#(L:switch_fuel_left, bool) ! (>L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1) M_RH_Fuel_Toggle#(L:switch_fuel_right, bool) ! (>L:switch_fuel_right, bool) (>K:TOGGLE_FUEL_VALVE_ENG2) John Expand Expand Thank you. I have given up on the Mustang. Sometimes the key presses work sometimes they don't. I have switched to the C700 Longitude. The above toggles only work in one direction, turns the valve on but not off with the second push. I understand the above in principle. But could you explain: C700s_ANTI_COLL#(L:LIGHTING_STROBE_1) ! s0 (>L:LIGHTING_STROBE_1) 1 l0 (>K:2:STROBES_SET), I don't understand the role of S0 and I0. What number is set into the >K:2:STROBES_SET? C700s_Elec_Stby_Pwr_On#(A:ELECTRICAL MASTER BATTERY:3, bool) ! if{ 3 (>K:TOGGLE_MASTER_BATTERY) } 0 (>L:XMLVAR_STBYBattery_Test), in this case is it asking if A:ELECTRICAL MASTER BATTERY:3 is not true. These things can get kind of tricky. Thanks
DaveSCUSA Posted June 13, 2024 Author Report Posted June 13, 2024 PS - A question I forgot to ask. Does including an LVar in a preset define the LVar in the Sim as it does in the model behaviors?
John Dowson Posted June 14, 2024 Report Posted June 14, 2024 On 6/13/2024 at 7:33 PM, DaveSCUSA said: I have given up on the Mustang. Expand Again? Then why post more questions in this topic, which is for assignments in the Mustang. On 6/13/2024 at 7:33 PM, DaveSCUSA said: Sometimes the key presses work sometimes they don't. Expand This should not happen - you need to use logging to see why this is happening. On 6/13/2024 at 7:33 PM, DaveSCUSA said: I have switched to the C700 Longitude. The above toggles only work in one direction, turns the valve on but not off with the second push. Expand Confusing - do you mean that toggle only works in one direction in the C700 Longitude, or in the C510? If you have questions on the C700 Longitude, please find an appropriate topic or create a new one. I will check that toggle in the C510 shortly and report back (can't do it now as it seems my MSFS is now stuck while 'checking for updates'...). On 6/13/2024 at 7:33 PM, DaveSCUSA said: I understand the above in principle. But could you explain: C700s_ANTI_COLL#(L:LIGHTING_STROBE_1) ! s0 (>L:LIGHTING_STROBE_1) 1 l0 (>K:2:STROBES_SET), I don't understand the role of S0 and I0. What number is set into the >K:2:STROBES_SET? Expand As O have said, I am no expert in calculator code, but the 's0' will store the value !(L:LIGHTING_STROBE_1) in register 0, and the s0 will use that, so it looks like two numbers are passed to K:2:STROBES_SET, 1 and !(L:LIGHTING_STROBE_1). On 6/13/2024 at 7:33 PM, DaveSCUSA said: C700s_Elec_Stby_Pwr_On#(A:ELECTRICAL MASTER BATTERY:3, bool) ! if{ 3 (>K:TOGGLE_MASTER_BATTERY) } 0 (>L:XMLVAR_STBYBattery_Test), in this case is it asking if A:ELECTRICAL MASTER BATTERY:3 is not true. Expand That is the conditional test, and when not true it executes '3 (>K:TOGGLE_MASTER_BATTERY)', then always executes ' 0 (>L:XMLVAR_STBYBattery_Test)'. The MSFS documentation on calculator code is now a lot better - see https://docs.flightsimulator.com/flighting/html/Additional_Information/Reverse_Polish_Notation.htm and for passing multiple parameters to key events (and simvars with multiple indeces), see https://docs.flightsimulator.com/flighting/html/Programming_Tools/SimVars/Simulation_Variables.htm#SimVars On 6/13/2024 at 7:33 PM, DaveSCUSA said: These things can get kind of tricky. Expand Yes, and I am no expert in these matters. FSUIPC just provides access to these features, which are provided by MSFS. Therefore the MSFS documentation should be consulted for calculator code implementation, and the best place to discuss calculator code and presets for various aircraft would be the MobiFlight forums (MSFS2020 channel), not here. On 6/13/2024 at 8:56 PM, DaveSCUSA said: PS - A question I forgot to ask. Does including an LVar in a preset define the LVar in the Sim as it does in the model behaviors? Expand Not sure what you mean by 'including'. If you try to write to an lvar that doesn't exist, it will be created. If you try and read from it, then I do not know (and wouldn't expect) if the lvar is created or not - I would expect to read a nil value. But all FSUIPC does is sends any preset/calculator code to the WASM and then executes it. John
John Dowson Posted June 14, 2024 Report Posted June 14, 2024 On 6/13/2024 at 7:33 PM, DaveSCUSA said: The above toggles only work in one direction, turns the valve on but not off with the second push. Expand I have tested those in the C510 now and they work perfectly here, so I think you must be doing something wrong. If assigning to a key press, make sure that you have checked No repeats!. Otherwise, you can use logging to see what the problem is. John
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