DrDave- Posted November 9, 2023 Report Posted November 9, 2023 John, We do appreciate the genius design and programming that has gone into FSUIPC. That being said, there is so much documentation it is hard finding where an answer in located even within a document. Many times we don't know what to search for. That being said, I have a question on myevents entries you provided for the C510. They are: Mustang_C510_Ignition1_Toggle#1 (>L:FSUIPC_C510_Ignition_1) Mustang_C510_Ignition1_Toggle#2 (>L:FSUIPC_C510_Ignition_2) I believe that these entries move the values from Mustang_... to L:FSUIPC_. The question is where can one find the variable "Mustang_C510_Ignition1_Toggle#1" in the aircraft files? I have discovered othe development variable types in this aircraft besides L: or B:. They are I: and O:. You found a B: variable in this aircraft. Can you inform us how you found the B: var and how we can find the I: and O: vars. Thank you
John Dowson Posted November 10, 2023 Report Posted November 10, 2023 9 hours ago, DrDave- said: That being said, I have a question on myevents entries you provided for the C510. They are: Mustang_C510_Ignition1_Toggle#1 (>L:FSUIPC_C510_Ignition_1) Mustang_C510_Ignition1_Toggle#2 (>L:FSUIPC_C510_Ignition_2) That preset will only work if you have added the additional code to the C510_interior.xml file, as explained in the post where I specified these. 9 hours ago, DrDave- said: I believe that these entries move the values from Mustang_... to L:FSUIPC_. No. Those presets change the value of the lvar L:FSUIPC_C510_Ignition_1/2, which is defined in the additional code that you have added to the C510_interior.xml file, 9 hours ago, DrDave- said: The question is where can one find the variable "Mustang_C510_Ignition1_Toggle#1" in the aircraft files? You cannot. That is the name of the preset, and only exists within FSUIPC. FSUIPC maps that preset name to the calculator code that is defined (i.e. '1 (>L:FSUIPC_C510_Ignition_1)'). The variable that exists in the sim is L:FSUIPC_C510_Ignition_1, and that is because you have manually added this (or should have). 9 hours ago, DrDave- said: I have discovered othe development variable types in this aircraft besides L: or B:. They are I: and O:. You found a B: variable in this aircraft. Can you inform us how you found the B: var and how we can find the I: and O: vars. You can only discover other variable types using the dev tools provided by MSFS. See https://www.badcasserole.com/uncovering-input-events-using-the-msfs2020-model-behavior-dialog/. Note that it is currently not possible to directly control B-type (and other variable types such as O) from external applications. The additional code you add to the C510_interior.xml file introduces an additional l-type variable (or lvar) to control the B:var. I am currently working on a new feature to allow assignments directly to 'Input Events', which are (as far as I am aware) closely related to B-type variables (if not exactly the same). I will be releasing this additional feature in a beta release in the next days, probably early next week. John
DrDave- Posted November 10, 2023 Author Report Posted November 10, 2023 Very comprehensive, thank you
DrDave- Posted November 10, 2023 Author Report Posted November 10, 2023 Again thank you. There are a few questions in my mind, may I ask them? 1. I have seen somewhere that one can perform an Ipc.readXX of an A: or K: variable. I can't seem to find it. Please repeat the format, it doesn't seem to be listed in the FSUIPC7: Lua Library Reference. Or what is the format to add an offset in "myOffsets". The examples don't show the variable or control type? 2. Similar to the above. How can one read and/or write to B: or O: variables? Obviously, one can read/write LVars. Some switches in the Mustang C510 are driven by A:, K: or L: variables. I can set an offset with the A: or K:. I can do a ipc.readLvar for the LVars. But how do I at least read the state of B: or O; vars? Thanks
John Dowson Posted November 10, 2023 Report Posted November 10, 2023 4 minutes ago, DrDave- said: I have seen somewhere that one can perform an Ipc.readXX of an A: or K: variable. I can't seem to find it. Not really. Those lua functions read offsets. Of course, if the offset holds an avar (aka simvar) or lvar, then you are reading the value of that variable. 6 minutes ago, DrDave- said: Please repeat the format, What does this mean? 6 minutes ago, DrDave- said: Or what is the format to add an offset in "myOffsets". The examples don't show the variable or control type? The examples how the variable, the type and the units, e.g. the example from the Advanced User guide: Quote // offset, size, simvar, type, units [, w] 0x66C0, 1, ELECTRICAL MASTER BATTERY:2,I32, Bool, w 0x66C1, 1, ATC HEAVY, I32, Bool, w 0x66C2, 2, COM VOLUME, I32, Percent 0x66C4, 1, COM SPACING MODE, I32, Enum, w 0x66C6, 2, TRANSPONDER CODE:1, I32, BCO16, w 0x66C8, 2, TRANSPONDER STATE, I32, Enum, w i.e. 3rd column is simvar/avar variable name, 4th column is type, as defined in the same place I am not sure what your problem is or why you are asking this.... 10 minutes ago, DrDave- said: 2. Similar to the above. How can one read and/or write to B: or O: variables? Obviously, one can read/write LVars. You can't, either via simconnect or guage code in the WASM. As I have said, I will be adding access to Input Events (aka B vars) in the next release. There is no access to O type variables at the moent. 12 minutes ago, DrDave- said: But how do I at least read the state of B: or O; vars? As I have said, no access at all to O vars. For B vars, no direct access at the moment (again, wait until I release access to Input Events). I have already shown you a hack to introduce an lvar to control b vars. Please try and understand the answers I have already given - you seem to be asking the same questions again and again. These new variable types are new to us all. And access is limited to such variable types. I have no further information other than what is provided in the MSFS SDK documentation. John
DrDave- Posted November 10, 2023 Author Report Posted November 10, 2023 1 hour ago, John Dowson said: Not really. Those lua functions read offsets. Of course, if the offset holds an avar (aka simvar) or lvar, then you are reading the value of that variable. What does this mean? I'm lookin for the format by which one can access variables via an A: SImvar, e.g. wf = ipc.readSB(A:WARNING FUEL LEFT) or ff = ipc.readSB(A:ON ANY RUNWAY). These variables are in the SImVars LIst but don't appear in the Offsets Status (that I can find). 1 hour ago, John Dowson said: As I have said, no access at all to O vars. For B vars, no direct access at the moment (again, wait until I release access to Input Events). I have already shown you a hack to introduce an lvar to control b vars. Please try and understand the answers I have already given - you seem to be asking the same questions again and again. I didn't know until you said above that the O: vars are not accessable. You used a B: var in the XML code (Engine Templates) you kindly provided and I was just looking for input on how I could do the same with other B: variables. Thanks
John Dowson Posted November 11, 2023 Report Posted November 11, 2023 11 hours ago, DrDave- said: I'm lookin for the format by which one can access variables via an A: SImvar, e.g. wf = ipc.readSB(A:WARNING FUEL LEFT) or ff = ipc.readSB(A:ON ANY RUNWAY). These variables are in the SImVars LIst but don't appear in the Offsets Status (that I can find). There are no such functions. To read a simvar that is not currently held in an offset, you have to first add it to an offset via the myOffsets.txt file, and then read the offset value. There is no direct way of reading a simvar due to the asynchronous nature of the simconnact API (i.e. you request a value and sometime later you will get the value back via a message). You can also write the value of a simvar to an lvar (using calc. code) and then read the value from the lvar, but I wouldn't recommend this method due to the delay between writing and reading - you have to wait for the updated value to be returned, also for the lvar to be recognised and returned to FSUIPC if the calc code also creates the lvar. 11 hours ago, DrDave- said: You used a B: var in the XML code (Engine Templates) you kindly provided and I was just looking for input on how I could do the same with other B: variables. You can use the same method. Or wait until next week when I release the beta which has access to Input Events. Note that the Input Events available are/will be restricted to the 'set' ones. Asobo have indicated that more Input Events (toggle, inc, dec) will be accessible in future updates. 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