John Dowson
Members-
Posts
12,277 -
Joined
-
Last visited
-
Days Won
250
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by John Dowson
-
I am very surprised that works... If you remove the general button section from your FSUIPC7.ini file, it will get added back with the default values. The ButtonRepeat rate is not read from a profile button section..... John
-
License sent. John
-
trying to extract numbers from string
John Dowson replied to shorthauler's topic in FSUIPC Support Pete Dowson Modules
But, as I keep saying, ypu shouldn't do this.... If you are storing a number in an offset as a 2-byte word, you should store it starting on a 2-byte offset, e.g. at 66C0 or 66C2. It way seem to work, but you can get problems if you don't do this, depending on how the offset is accessed... Rather than have it run in an endless loop, you can use the event.offset function, using offset 0xABCD, so that you update each time that offset changes value - this would be more efficient. -
A non Aircraft specific Question regarding MSFS Vars
John Dowson replied to Airbuspilot's topic in FSUIPC7 MSFS
What version of the A320 are you using? The MF presets for the glareshield lights are for the dev version only - did you try in that version? -
License sent. John
-
A non Aircraft specific Question regarding MSFS Vars
John Dowson replied to Airbuspilot's topic in FSUIPC7 MSFS
You should add your own presets to the myevents.txt file, not the events.txt file, as that will get replaced the next time you update. Executing a preset is EXACTLY the same as executing the calculator code associated to the preset, so you can use either ipc.execPreset("A32NX_OH_INTEG_LIGHT_25") or ipc.execCalcCode("(A:LIGHT POTENTIOMETER:86,percent) 25 (>K:2:LIGHT_POTENTIOMETER_SET)") Note also that the '(A:LIGHT POTENTIOMETER:86,percent)' part is redundant, as this just reads the value and then that value is ignored. it is the same as just ipc.execCalcCode("25 (>K:2:LIGHT_POTENTIOMETER_SET)") as I wrote in my previous comment, and you have said that this doesn't work... if you need calculator code for a specific function, you can ask about this on the MSFS2020 channel of the MobiFlight discord server. That is the community resource you should use for asking the community for the calculator code needed to implement a specific function. -
key press to repeat while held remains blank
John Dowson replied to amicodepla's topic in FSUIPC7 MSFS
The key press to repeat while held applies to the key sent on button press, not release. As you have nothing assigned to the press, only on release, the repeat option doesn't matter and so is not saved. Try assigning to the press instead of the release. John -
trying to extract numbers from string
John Dowson replied to shorthauler's topic in FSUIPC Support Pete Dowson Modules
But you should not do his... a float is 4 bytes/32-bits, and so you should write on a 4-byte boundary. This will also overwrite offsets 66C2, CC63 & 66C4 This is how floating point numbers work - they are not exact. If you only want to store to 2 decimal places, store the value * 100 as an int, and just remember to divide by 100 when you read it. The size of the offset that you need to store the number depends on the range - you can use 2-bytes if its always between -32,768 to 32,767 (signed) or 0-65,535 (signed), and 4-bytes for the full int range (-2,147,483,648 to 2,147,483,647 signed, 0 to 4,294,967,295 unsigned). And 1-byte if its between 0-255 (unsigned) or -128 - + 127 (signed). Remember to always read the same size as writing, don't overlap your offsets (i.e. make sure you leave enough space for the offset to hold the data before assigning the next offset value), and respect offset boundaries depending on the size of the data the offset holds (as I explained in the other post!). John -
Ok, thats interesting. So it takes the profile settings if there are no general ones. I can check the code to see what the actual detail is, just can't remember off-hand...! John
-
Not really...just think about it. If you write one bye to offset 66C1, it will occupy that byte. If you write 2 bytes, it will occupy 66C1 and 66C2. And the same when you read them, so if you are reading 2-bytes, starting at 66C1, then you are reading 66C1 and 66C2. Similarly, if you were reading it as 4-bytes, you would be reading 66C1, 66C2, 66C3 & 66C4. When you are using offsets for your own needs, remember also to respect byte-boundaries. This means that a 2-byte word must start on a 2-byte boundary (offset address ending in 0,2,4,6,8,A,C or E), a 4-byte double-word must start on a 4-byte boundary (offset address ending in 0, 4, 8 or C), etc. It should be ok if you send it as a single-byte. if you are sending it as a 16-bit word (2-bytes) you shoul move it to a 2-byte boundary. You should space them as needed, and respect the boundaries when using more than one byte (strings excepted, they don't need to be aligned).
-
C# app integration for hardware and WASM module
John Dowson replied to brandonharwood14's topic in FSUIPC Client DLL for .NET
Probably yes. FSUIPC4 and above uses SimConnect in the background for most things. @John Dowson will be able to confirm. Yes - everything goes via SimConnect anyway, either to the FS or the WASM. But you can also send "legacy" events via calculator code, using them as k-type variables. -
A non Aircraft specific Question regarding MSFS Vars
John Dowson replied to Airbuspilot's topic in FSUIPC7 MSFS
As I said, not all simvars (a-type variables) are settable directly. The MSFS SDK lists the available simvars and their settable status, but this one is not documented, so is probably settable. This is why the presets only read this simvar and use the k-type variable, which is an event or control, to update. As simvars can also be updated by sending the appropriate event. instead of updating directly, why not use: ipc.execCalcCode("50 (>K:2:LIGHT_POTENTIOMETER_SET)") John -
In the first ini you posted, you had this: This will run SerialFP2 straight away which will grab the port and prevent FSUIPC from opening it - although I no longer see this in your latest ini. Please read the Appendix Handling VRInsight serial devices in FSUIPC in the Advanced User guide for details on setting up your VRInsight device. Ok, great - what was the issue? John
-
I think such buttons can cause issues when assigned in MSFS as you would get continual button press events, but this shouldn't be a problem when assigned in FSUIPC as it handles repeat button presses differently - it will only repeat the press when asked and will repeat at the rate configured until a button release is seen. John
-
I think the ButtonRepeat (and PollInterval) parameters are only read from the general (none-profile) section, as general button assignments are inherited (unless overwritten) in a profile. There can only be one repeat rate set for all button assignments. John
-
A non Aircraft specific Question regarding MSFS Vars
John Dowson replied to Airbuspilot's topic in FSUIPC7 MSFS
There are two presets for this: A32NX_OH_INTEG_LIGHT_INC and A32NX_OH_INTEG_LIGHT_DEC. Why don't you use them? This is the calculator code for the inc: (A:LIGHT POTENTIOMETER:86,percent) 5 + 100 min 86 (>K:2:LIGHT_POTENTIOMETER_SET) So it using index 86 (not 84), and reading the value from the simvar but using the event to set it. See the HubHop site if you haven't already (https://hubhop.mobiflight.com/presets/). You can assign directly to MF presets in FSUIPC7. Make sure that you are using the latest version (7.3.23) as this has an additional facility/button (Find Preset) that makes finding presets a lot easier. Please see the Advanced User guide on using presets. And for the glareshield (which uses 84), these presets are available: A32NX_LIGHTS_GLARESHIELD2_INC, A32NX_LIGHTS_GLARESHIELD2_DEC, A32NX_LIGHTS_GLARESHIELD2_PERCENT The last one is output only, and just reads the simvar LIGHT POTENTIOMETER:84. John -
Your axis goes from 16383 to -16384, this code (in Revers Polish Notation, or RPN) '@ 16384 + 327.68 /' takes the input ('@'), adds 16384 ('@ 16384 +'), giving a range of 32768-0, and then divides the result by 327.68 ('327.68 /'), giving a range of 100-0. so it converts the range +16383 to -16384 to +100 to 0. You could try reversing the axis, i.e. add '-1 * ('@ -1 * 16384 + 327.68 /....'). What do you see in the outside view - can you see the spoilers extending and retracting with your lever? The movement will not be linear, as the preset sets the position according to those custom controls: down, arm, 50%, FLT_DET, Up. You can adjust the numbers in the preset code (5, 10, 50, 70, 95) to change the position for each of those positions. I have finished now - I can look into this further over the weekend if you are still having difficulties.
-
having multiple if-statements in one file
John Dowson replied to shorthauler's topic in FSUIPC Support Pete Dowson Modules
This one is for 'having multiple if-statements in one file'.... I don't mind helping out with lua questions, but I am no lua expert. I support FSUIPC really, not lua. FSUIPC includes a lua interpreter, but for non-fsuipc related lua questions, you should refer to the available lua resources on the web. That is what I do when I get asked such questions... John -
trying to extract numbers from string
John Dowson replied to shorthauler's topic in FSUIPC Support Pete Dowson Modules
Should be: speed = getnumbersfromtext(spdstate) You have to pass the text into the function... And you would normally define your functions at the top of the script. -
Note the preset is using the following PMDG custom controls via the ROTOR Brake method: #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER (THIRD_PARTY_EVENT_ID_MIN + 679) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_DOWN (THIRD_PARTY_EVENT_ID_MIN + 6791) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_ARM (THIRD_PARTY_EVENT_ID_MIN + 6792) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_50PCT (THIRD_PARTY_EVENT_ID_MIN + 6793) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_FLT_DET (THIRD_PARTY_EVENT_ID_MIN + 6794) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_UP (THIRD_PARTY_EVENT_ID_MIN + 6795) You can achieve the same as the preset by sending these custom controls when entering an axis range, using the right-hand side of the axis assignment dialog, if you prefer. See the FAQ section on how to use custom controls for PMDG aircraft. John
-
Thats strange, as I can see it moving here. Note also that there is the Axis Spoilers Set control. However, this control doesn't work well for the spoilers in the PMDG 737, There is a preset available for assigning an axis to spoilers in the 737: PMDG B737 Spoiler Lever Set However, this preset is not in the events.txt file for some reason. You can add this to your myevents.txt file (create this file if it doesn't exist) and add this preset to this file: Note I have changed this from the MF preset as my axis goes from -16384 to +16383 - you can adjust these values to suit your axis range (highlighted in bold above) Once you have added this preset to the myevents.txt file, restart FSUIPC7. You can then assign to this preset by checking Send Preset to FS box and then selecting the preset from the drop-down.
-
A non Aircraft specific Question regarding MSFS Vars
John Dowson replied to Airbuspilot's topic in FSUIPC7 MSFS
Could you explain what you are trying to achieve? Which aircraft and what function? Have you looked to see if there is already a preset available? -
But you don't have any flap detents configured (no FlapStarts and FlapEnds entries) although you have flap detents active, and why are you also sending flaps inc/dec controls in the flaps axis range: ? Your aileron and throttle assignments also have range settings which also seem strange... And I am still confused by this profile: ?
-
Can you switch to using 'Send to FS as normal axis' and generate a log file with Axes Controls logging enabled, then load your aircraft and slowly move the assigned spoiler lever through its full range and back. Then exit FSUIPC7 and show me/attach your FSUIPC7.log and FSUIPC7.ini files. Do you have any assignments in MSFS? If so, please check if the spoilers are also assigned there,