Jump to content
The simFlight Network Forums

Detlef_747

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by Detlef_747

  1. 30 minutes ago, Detlef_747 said:

    I generate the output you see here from the Lvars I read from FSUIPC via the interface provided from Sim Innovations.

    I do that, because I don't know PMDG variables I can directly use for some instruments of the B737. For almost all instruments I see the Lvar directly in the XML behaviour file provided with the aircraft. But for some not. And here I do use your offsets from the file Offset Mapping for PMDG 737-700.pdf. That has helped me a lot. The "SDK" which just seems to be a PMDG_NG3_SDK.h file is of no help for me right now.

    Detlef

     

  2. 6 hours ago, John Dowson said:

    But I don't really understand what you are trying to achieve... as you have the PMDG data on the offsets, why fo you want to use this to create lvars? And what data do you want to write to offsets? And what has this got to do with this topic, which I thought was about using lvars that were strings.

    John,

    thank you for your explanations. They are helpful for me. I think I have to stay with my solution. I don't want to write data to offsets, just read them and write the contents into Lvars. 

    I use Siminnovations Airmanager to create instruments on a touchscreen. That software cannot access offsets in FSUIPC. Rather it waits for changes on MSFS simulator variables such as Lvars and then uses the information from the Lvar to control the instruments on the touchscreen. For example:

    Offset 64C9 13 char[13] ELEC_MeterDisplayBottom[13] has the information for the bottom line of this instrument:

    image.png.3608731e6ca6ee7e6e94db137db47f1b.png

    I generate the output you see here from the Lvars I read from FSUIPC via the interface provided from Sim Innovations.

    However, it only seems to work with numerical type Lvars. I was not able to see contents from String Lvars generated in FSUIPC, even though I tried to read them as strings. I can live with that now because FSUIPC allows me to generate multiple Lvars (type float) so that I spread the information from the offset on three separate Lvars.

    I am not sure I made myself more understandable. I just wanted to understand if and how string Lvars work. If I read the Lvar L:ipcpmdg_DC_Voltmeter generated with stringTest.lua inside the Siminnovations Airmanager, I get the numerical representation for example 9.0251229459308e-308 if I read it as number, and I get "" (an empty string) if I read it as string. That seems to be not an FSUIPC problem but someting in the Siminnovations interface.

    I currently experiment some more, just had a complete CTD of MSFS and it won't restart now. I need to restart my computer now...

    Detlef

     

     

     

     

     

  3. 8 hours ago, John Dowson said:

    I think you also need to add data to offsets respecting the offset boundaries for the types you are adding. What this means is the words (e.g. UW, SW) should be added on 2-byte boundaries, dwords (e.g. SD, UD) on 4-nyte boundaries, etc. I am not 100% sure on this without checking the code, but probably a good idea to allocate your offsets with this in mind.

    John

    Hi again,

    I know what alignment on words, dword and so on is. But I do not understand, how I should add data to offsets. The PMDG offsets do work as you provide them in the file Offset Mapping for PMDG 737-700.pdf. 

    Thank you again,

    Detlef

  4. 8 hours ago, John Dowson said:

    All lvars are handled internally as 8 byte doubles, so the maximum string length of an lvar is always 8 characters.

    John,

    thank you for your fast reply. Ok, 8 characters max.  That means the 13 character offsets for example

    64BC 13 char[13] ELEC_MeterDisplayTop[13]

    from the PMDG offset won't work as one piece at leasts. As I said, I found a way arround it. Interpreting the string in the FSUIPC .lua script and write to separate Lvars.

     

    8 hours ago, John Dowson said:

    please see the example script I have attached. This creates an lvar, and sets a timer to update this to a different string value every second. There is an event set to pick up the lvar change, and then write the lvar value to an offset. The event on this offset then picks up the new string value for the lvar and just logs it.

    Thank you for providing the example script. I understand how the script should work but it does not assign a value other than 0 (approx 1.3e-307) to the Lvar. Or I am doing something wrong (which is often..). The counter value is not assigned to the Lvar. This is from the log file:

    79860 LUA.3: Lvar updated: 1.1232813414918e-307, type=number
       279875 LUA.3: Lvar value: myvar14
       279938 LUA.3: Offset updated: myvar14
       280907 LUA.3: Lvar updated: 1.1789081879545e-307, type=number

     

  5. Hello,

    we have been in contact on Lvars some time ago. I have worked with the PMDG offsets more recently. I find, that I can generate Lvars that represent a float number just fine. But string Lvars don't work. So I did a work arround in the lua script attached.

    For example

    event.offset(0x64bc, "STR", 13, "ChangeMeterTopLine")
    calls the function ChangeMeterTopLine just fine. But I cannot write the string into an Lvar at once, so I interpret the string in the FSUIPC lua script and write to a couple of numerical (float) Lvars instead.

    Did I miss something with string Lvars? I only found ipc.createLvar(). Are there other functions I could use?

    Thank you

    Detlef

     

     

    PmdgOk.lua

  6. John,

    I have had the registered version of FSUIPC(7 now) for so long, that I don't know what the non-pay version can do. I ask, because I want to provide a lua script to others. Do they have to buy FSUIPC7 in order to be able to start lua scripts automatically?

    Thank you

    Detlef

     

  7. 5 hours ago, John Dowson said:

    As to your issue with the PMDG data not being received, I don't know what can be causing this., it is very strange. Maybe try uninstalling the PMDG 737 completely, then re-install and check broadcasting enabled and try  again.

    Installing the latest version sometimes does miricles..    I updated the aircraft to the latest PMDG 737 version, and the offsets mentioned above do work now!

    5 hours ago, John Dowson said:

    I have found the issue that can cause FSUIPC to crash when creating lvars and/or reloading the WASM in succession. This will be fixed in the next release, but for the time being please add an ipc.sleep call after creating an lvar.

    The lvars creation also works. I will leave the ipc.sleep calls inserted until the next FSUIPC7 version. I will try with a list of offsets, which will sum up the wating time, but that really is not a problem right now.

    Thanks again for your help. I very much appreciate it. The issue is solved.

    Detlef

     

  8. 21 hours ago, John Dowson said:

    Did you not set logging for Lua plugins? If not, please do that, and log to the standard log file (i.e. do not Log Lua Separately).

    John, thank you for the ongoing support. Sorry I deactivated the Lua logging at some point. I have it on again now.

     

    21 hours ago, John Dowson said:

    This is correct - it only logs the first reception of data, and not subsequent ones. To log every reception (and a lot more), you can use the Log->Custom option and enter x4000 - this will log everything received via SimConnect.

    Can you please try logging offset 0x65EA using FSUIPC's offset monitoring facilities, then remove the nose wheel switch guard and toggle the nose wheel steering switch a few times and see if the offset changes.

    Both is on now. I also activated the option to see offset 65EA in the windows title. It always says 0.  I have activated event logging also. Usually I would send event 32503 to operate the nose wheel steering switch. If I look at the log file, that event is present, but still offset 65EA is not changing in my environment here.

    Thank you for sending your log file. Yes, I see it is working in your setup. Something must be wrong or different in my setup.

    I have not yet tried with a modified lua script. But that seems not to be the main issue.

    Thank you

    Detlef

     

    FSUIPC7.log FSUIPC7.ini

  9. 1 hour ago, John Dowson said:

    You could check the following offsets which are the most recent ones i have checked as working

    Unfortunately I am also reading 0 all the time from those two offsets you mentioned. And I operated "arm spoiler" and the nose wheel steering switch.

    ipc.readUB(0x65ea)
    ipc.readUB(0x65fd)
     

    1 hour ago, John Dowson said:

    Otherwise, you can add the following to the [General] section of your FSUIPC7.ini which will log the reception of PMDG client data:
        TestOptions=x400

    I did that. The log file says:

       267687 PMDG 737 Client Data Received: ID=1313289013, Size=1049, FirstDataDW=536870944 (FSUIPC7 logfile attached)

    It says that just once, not repetatively.
     

    I may still be missing something.

    Thank you

    Detlef

     

    FSUIPC7.log pmdg737.lua

  10. 14 hours ago, John Dowson said:

    But the problem looks to be that the offset value isn't changing, no? Presuming that is the correct offset (I have only spot-checked some and calculated the rest from an SDK file) and if so then the data isn't being provided correctly. As the SDK for the PMDG 737 for MSFS has still not been published, there is not much that can be done at the moment.

    I will take a look at this to verify (tomorrow now) and will start to maintain a list of of valid/invalid offsets for the PMDG 737 - should have done this at release!

    Hi John,

    I experimented some more this morning. With the Cirrus aircraft (FS2020 default) everything works as expected. I can read from offset 0x0bfc (flaps index) and write that value into an Lvar that I create myself (L:my_flaps_index). I can see and work with that Lvar in Air Manager (which is my goal). The Lvar also shows up in the Lvar list, if I generate one with the FSUIPC menu call.

    I have attached the resulting files here.

    However, if I try with PMDG offsets, I always see 0 as value. (Maybe some do work, that I did not try.) Can I somehow verify that the PMDG 737 is broadcasting its data? (I have the SDK section in the 737options.ini file but maybe something else is missing in my settings).

    Thank you

    Detlef

     

    pmdg737.lua FSUIPC7.ini FSUIPC7.log pmdg737.log

  11. 45 minutes ago, John Dowson said:

    Try with:
     

    ipc.createLvar("ipcpmdg_ELEC_annunAPU_GEN_OFF_BUS", 1234)
    ipc.createLvar("ipcpmdg_APU_EGTNeedle", 4321)
    ipc.reloadWASM()
    ipc.sleep(1000)
    ...

    i.e. you need to reload thee lvars from the WASM a before they become available. Note also that if a reload results in more lvars being found than previously (which of course there will be as you have created some), then this will/should trigger the reload of the [LvarOffsets] section from the ini.

    John

    I just did. The Lua program stops running then I think. I am not sure I should restart everything. I will try more tomorrow. And I will try again with offsets for a default aircraft.

    Thank you

    Detlef

     

    pmdg737.log pmdg737.lua

  12. John, 

    thank you for your fast reply.

    6 hours ago, John Dowson said:

    I am slightly confused by your post. The PMDG offsets are not lvars, it is additional read-only data provided by PMDG.

    I am sorry if I sound confusing. My intention is to read contents from offsets and write that contents into Lvars that I create myself using Lua script in FSUIPC.

     

    6 hours ago, John Dowson said:

    What happens> Show me the lua scrip, and activate logging for lua plugins and see if you get any errors. Note that if creating youy own lvars, it may take a short time before that lvar is available for reading/writing.

    I did that here. See the attachment. I modified my lua script to be as simple as possible and inserted a 5 second pause before trying to write to the Lvar. My problem here: I always read 0 as value. I actually see the Lvars I created in my Airmanager instrument with their initial values 1234.0 and 4321.0 respectively. But after 5 s the display switches to 0. I have attached the files here.  So I seem to never get any data from the offsets.

     

    6 hours ago, John Dowson said:

    Do those lvars exist, or are you creating them? You cannot add lvars that you create using the [LvarOffsets] section as this is only processed when the initial lvars are received from the WASM.

    I am sorry if I was confusing here. I did not try both at the same time. So when trying the .ini section I did not use a Lua script to generate Lvars.

    So in the files attached I had the PMDG 737-700 running, with engines off, APU on. I tried these specific offsets because I know how I can use PMDGs original Lvars for that. So I know they should work (0x64bb and 0x64E8).
     

    Thank you 

    Detlef

     

     

    pmdg737.log FSUIPC7.ini FSUIPC7.log

  13. Hello,

    I updated to FSUIPC7 7.3.8 yesterday, because I saw the offset list for the PMDG 737. But somehow I couldn't get Lvars working correctly. I am familiar with Lua and am using it for Sim Innovations Air Manager instruments. I wanted to create my own Lvars with an FSUIPC Lua script. If I create the Lvar using ipc.createLvar(name, 1234) giving an initial value of 1234 that Lvar shows up as expected. But I cannot write to it using ipc.writeLvar(name, ipc.readUB(offset). I have added this section

    to 737options.ini  in  C:\Users\dreu\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState\packages\pmdg-aircraft-737\work

    [SDK]
    EnableDataBroadcast=1
    EnableCDUBroadcast.0=1
    EnableCDUBroadcast.1=1

    (and restart of everything) with no better results.

    I then saw that I could write Lvars directly into the fsuip7.ini file. I tried this:

    [LvarOffsets]
    1=L:IPCPMDG_MAIN_annunAP=UB0x65F1
    2=L:IPCPMDG_MAIN_annunAP_Amber=UB0x65F3
    3=L:IPCPMDG_MAIN_annunAT=UB0x65F5
    4=L:IPCPMDG_MAIN_annunAT_Amber=UB0x65F7
    5=L:IPCPMDG_MAIN_annunFMC=UB0x65F9
    6=L:IPCPMDG_FUEL_PumpFwdSw=UB0x6479

    resulting in entries in the log file, saying the variable cannot be assigned because it does not exist. That remains so after clicking WASM reload in the menu. So I tried in a Lua script to only generate an Lvar if it does not already exist, but ipc.getLvarId(name) always returns not nil (meaning the Lvar already exists?)

    I then tried with the default Cirrus aircraft and got no better results. I see that I can read from offsets but I cannot write them to Lvars.

    I have tried all I can think of, so I would appreciate your help. I attach my latest log file here. That one was with the cirrus.

    Thank you

    Detlef

     

     

     

    FSUIPC7.log

  14. Quote

    But note that your else clause to read the lvar using ipc.readLvarSTR will never be reached. Even if the lvar was actually holding a string value, the ipc.readLvar would still read the value and return the string interpreted as a floating point number. You really need to know that the lvar is holding a string value before using that function.

    Hi John,

    I see. Thank you for explaining, and also your further comments.

    20 hours ago, John Dowson said:

    There are no values associated with hvars - you can only activate them.

    "Activate" means trigger an event? Is it the same as an event? Only it is called Hvar in this case? Sorry, if a silly question.

    Thank you

    Detlef

     

  15. Hi,

    I have started to write a simple variable tracker for Lvars and Hvars. Starting from the Lua examples log lvars.lua and record to csv.lua I managed to generate a .csv file in the format I need.

    I noticed that there are these library functions:

    ipc.readLvar("name")   and

    ipc.readLvarSTR("name)

    Trying with the FlyByWire A320 for FS2020 I found no STR variable at all Is that just the aircraft or am I doing something wrong?

    -- By using "assert" you get an error message if this fails
    f = assert(io.open("am_fs2020_vars.csv","w"))
    
    
    -- write the CSV column headings
    -- possible Types: L (for Lvars), H (for Hvars)
    -- poosible Subtypes: F (for float), S (for string), U (for unknown)    default is F
    --f:write("\r\nType,Subtype,Name\n")
    f:write("Type,Subtype,Name,Value\n")
    
    ipc.log("Searching for Lvars")
    
    count = 0
    for id=0, 65535 do
      name = ipc.getLvarName(id)
      if id == nil then break end
      subtype = "U"
      value = ipc.readLvar(name)
      if value ~= nil then
        subtype = "F"
      else
        value = ipc.readLvarSTR(name)
        if value ~= nil then
          subtype = "S"
        end
      end
      count = count+1
      f:write(string.format("L,%s,%s,", subtype, name))
      if subtype == "F" then
        f:write(string.format("%0.6f", value))
      elseif subtype == "S" then
        f:write(string.format("(((%s)))", value))
      else
        f:write("(((unknown)))")
      end
      f:write("\n")
    end
    
    ipc.log(count .. " Lvars found.")
    
    -- write a CSV line to the open file
    f:write(string.format("A test: %02.4f\n", 3))
    
    -- tidy up at end ...
    f:write("\n")
    f:close()

    And some more questions:

    1) There are no STR variables for Hvars, right?

    2) Is there a way to find out the unit, that an Lvar is using? E.g.  ft or degrees or bar... ?

    3) Is there a way to see what are output, what are input variables?

    Thank you

    Detlef

     

     

  16. Hi,

    I am in the process of getting familiar again with FSUIPC after some long pause. I somehow cannot figure out, how to have FSUIPC permanently forget some key assignments. 

    I programmed the key 1 to send Flaps Incr to FS2020. I want to clear that assignment. So I go to Key Assignments, I press Set, then the 1-key. I press Clear and Confirm, then Ok.

    If I then press Set and 1, the key assignment is removed as I want it.  But after some time or restart or  aircraft reload or some event (I have not figured out exactly which one) the key assignments are re-stored which I do not want.

    What am I doing wrong?

    Thank you

    Detlef

     

     

  17. 1 hour ago, John Dowson said:

    As the message says, you need to select the correct device before toy assign to that device - your devices are shown above the assignments with the current profile the device is using. If assigning in FSUIPC, you should start/create a new empty profile for that device.

    But this is not the place for MSFS support really. You should familiarise yourself with MSFS before configuring FSUIPC.

    Hi John,

    thank you again. I was aware of the above. I have it sorted out now. Basically my issues had two reasons,

    (1) I have a ten EUR or so mini wireless keyboard and touchpad connected via USB that I use sometimes during flying when my normal keyboard is stored away (I have self built switches and dials and so on).   As soon as I removed that wireless keyboard I could assign buttons in the MS UI as intended. That error "you are trying to assign an action to a device that is not selected" also came from that. The UI saw a different USB device than the one I HAD selected.

    (2) flaps setting went back automatically to 10 degrees because some assistance function was active. I set everything to "hard" now and both, UI and FSUIPC assignment, do work now.

    So all my fault...

    Detlef

     

  18. Hi again John,

    thanks for your continued support. I seem to have some other basic problems now with FS2020. In the FS UI, if I try to assign a function to a joystick button I get: "you are trying to assign an action to a device that is not selected".  I need to solve that one before looking deeper into my original topic here.

    Detlef

     

  19. John,

    I am totally unfamilar until now with MSFS2020. I just noticed: if I use the FSIM user interface, I hear a click when putting the flaps out a notch, and a delayed second click without me touching the control button again. Looking at the instrument in the cockpit I just saw that the flap lever goes back to the middle position (APH) with the delayed click. I I try to program the buttons via FSUIPC the lever tries to move but instantly moves back into the middle position resulting in no flap movement.

    So maybe another kind of control is sent within the UI for the flap lever movement.

    Detlef

     

×
×
  • 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.