Jump to content
The simFlight Network Forums

Cockspur C510 assignments too complicated


DaveSCUSA

Recommended Posts

8 minutes ago, DaveSCUSA said:

There are switchs that have eluded me. They are both the fuel valves in the VC located on the trottle handles.

Yes, those are the ones that I couldn't find anything for, as I said:
 

On 4/11/2024 at 8:12 PM, John Dowson said:

The only difficulty I am having at the moment is for the fuel cut-off triggers

and later:

On 6/5/2024 at 4: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

 

10 minutes ago, DaveSCUSA said:

Are there any other methods to discover the items that drive these fuel events?

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

Link to comment
Share on other sites

17 minutes ago, 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

Thank you. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

25 minutes ago, DaveSCUSA said:

I assigned each to offsets 66C6 and 66C7 and entered them in the offset log.

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).

29 minutes ago, DaveSCUSA said:

Started the C510, exercised the fuel valves and didn't show any activity except the toggle events.

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...,).

 

Link to comment
Share on other sites

2 hours ago, 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.

2 hours ago, John Dowson said:

Sorry, what does this mean? Do those lvars work to control the fuel valves or not?

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) ! (&gt;L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1)</LEFT_SINGLE_CODE>

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

10 hours ago, 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.

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).

10 hours ago, 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.

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.

10 hours ago, DaveSCUSA said:

A sample of code from the C510_interior.xml file is <LEFT_SINGLE_CODE>(L:switch_fuel_left, bool) ! (&gt;L:switch_fuel_left, bool) (>K:TOGGLE_FUEL_VALVE_ENG1)</LEFT_SINGLE_CODE>

So that toggles an lvar value and triggers and event.

5 hours ago, 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)

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

On 6/7/2024 at 5:32 AM, John Dowson said:

 

On 6/7/2024 at 5: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

 

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

 

Link to comment
Share on other sites

12 hours ago, DaveSCUSA said:

I have given up on the Mustang.

Again? Then why post more questions in this topic, which is for assignments in the Mustang.

12 hours ago, DaveSCUSA said:

Sometimes the key presses work sometimes they don't.

This should not happen - you need to use logging to see why this is happening.

12 hours ago, 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.

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'...).

13 hours ago, 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?

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).

13 hours ago, 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.

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

13 hours ago, DaveSCUSA said:

These things can get kind of tricky.

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.

11 hours ago, 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?

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

Link to comment
Share on other sites

16 hours ago, DaveSCUSA said:

The above toggles only work in one direction, turns the valve on but not off with the second push.

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

Link to comment
Share on other sites

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.