Jump to content
The simFlight Network Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About dwilliams

  • Rank

Profile Information

  • Gender
  • Location
    Long Beach, California, USA
  1. Paul, that is exactly what is wrong - thanks for unconfusing me. Too many Wide apps. I need WidevieW (or Opus FSI apparently). And thanks Gilles for pointing out the lua examples. I like to fool with lua to hook Arduinos to the sim. - Dave
  2. Trying to split visuals across two PCs. Main pc has p3dv4 and its version of FSUIPC/wideview. Other has p3dv3 and widefs client. I start p3d on the main. I start widefs on the client and it connects. I then try to start p3d on the client pc and get an error message that a p3d is already running. If I try a different order, starting p3d on the client, then widefs won’t run - error message says that the same class of program is already running. I know the answer must be simple but it escapes me. Thanks - Dave
  3. Don't understand what is going on here. I have a Bodnar BBI-32 with one rotary installed on its B1/B2 pins (read as joystick 1, buttons 0/1 in registered FSUIPC 4.958). I have assigned the rotary's B2 pin to VOR1 OBI INC. When I rotate the rotary it indeed increments the OBI but it also cycles the view - which is what button 1 on my Thrustmaster Top Gun Fox 2 Pro does by default. In FSUIPC this Top Gun button shows up in as joystick 0, button 1. Why would the rotary also trigger the view change? Windows 8.1, Prepar3d 3.4. Regards, David Update - solved. See Mr. Dowson's reply.
  4. I'm new to Lua, but it can be compiled or interpreted I understand. Meaning, with the right utility, you could develop you script outside of FSX (spoofing relevant I/O of course) without having to fire up the sim every time. I do this with my Arduino code, communicating with serial port windows and making sure the code is working as I want before I hook it up with Lua/FS. But if you are looking for the equivalent of an "in-system debugger", I am too newbie myself to know. -Dave
  5. Thanks, Pete. In replicating a Garmin flight controller, my panel just has rotaries and push buttons - the display is the PFD, but I get what you are saying. I'll keep my local variables in sync with what I send and ignore returns from FS/Lua until the micro sees a break in twisting knobs. What have you found to be the practical limit on sending to Lua, assuming it has to do string matches before it ipc writes? I think I have seen cases (viewing ipc.log on console) where if I send updates from the micro too fast, Lua seems to lose some characters? Or maybe that is due to logging delay? In any case you have given me enough to experiment with. Thanks again - Dave
  6. Thanks Reinhard and Pete - see Lua below. My test hardware is simply a debounced rotary encoder with an Arduino keeping track of the current OBS position locally, adding or subtracting clicks from the encoder, and sending updates to the script. In turn, the script passes the new value to the sim via ipc.write. As the new value is ingested by the sim, the corresponding event triggers and the script sends the updated value (which should be the same as just received by the Arduino) back to the Arduino via a com.write . Problem is, it seems when the script receives several quick updates in a row and make several quick ipc writes, it can receive an event for an earlier update - which is promptly sent back to the Arduino, which now thinks this value is current so resets what it is sending. e.g., as one spins the the OBS, the display (I am just watching the OBS needle on the default G1000 PDF) might read 55, 56, 57, 58, 59, 56, 57, ... note the skip back to 56 as the event corresponding to 56 is triggered. I am sure this is just a basic concept I need to get straight since I know it has been solved. -Dave dev = com.open("COM4", 115200, 0) if dev == 0 then ipc.display("Could not open port") ipc.exit() end --------------------------------------------- function handlecom(handle, str) if string.match(str, "Control:(%d)") then ipc.control(tonumber(string.match(str, "(%d)"))) end if string.match(str, "CRS:(%d)") then val = tonumber(string.match(str, "(%d+)")) ipc.writeUW(0x0c4e, val) -- NAV1 OBS Setting (degrees, 0-359 end end ---------------------------------------------- function CRS (offset, value) com.write(dev, "CRS:" .. value .. ":\n") end ---------------------------------------------- ipc.sleep(500) event.com(dev, 20, 5, 0, "handlecom") event.offset(0x0c4e, "UW", "CRS") -- NAV1 OBS Setting (degrees, 0-359)
  7. As a rotary encoder on my hardware panel turns I'm sending NAV1 OBS Setting updates to the sim. But if I also am watching for change events on that offset (to update the value stored by the panel, or possibly to accommodate an active flight plan changing the value) I get into a sync problem where the event handler function can't keep up with the incoming encoder updates. Is it possible to do an ipc.write to an offset without that offset immediately triggering it's own change event? Or alternatively in Lua, dynamically enable and disable events? Regards, Dave Long Beach
  8. Thanks Pete: the quickest response I ever got on a forum - you even beat my immediate edits for misspelling. I'll remember to post during London evenings. And exactly the advice I was looking for, from someone who has already done it. Many thanks. -Dave
  9. Hi. I am interfacing a custom radio panel controlled via Arduino with FSX via FSUIPC/Lua. My question is which of these two architectures would be better in terms of performance. First, the micro could send encoder closures that Lua will translate on the fly. For example, for Nav1 increment, Lua would execute a bunch of ipc.control(1038) to tune up, and rely on event.offset (0x0350, "UW", someFunction) to get the updated freq back to the Arduino/panel for display. Or, second, the micro could keep track of frequency locally during tuning and write the absolute value periodically (every few ticks). For example, send an ipc.writeUW (0x0350, val) to hard set the sim and display the same freq locally without looking for an update from Lua. If this is the wrong kind of question for this forum, please advise, but if not, does anyone have an opinion or an alternate suggestion? Regards, Dave Long Beach (very near KLGB)
  10. Bought the program, installed it, got the list of LVARs, made a macro, assigned it to a key --- works like a charm! Thanks, Pete. Now to learn the com stuff. -Dave
  11. Thanks, Pete. It does look like the LVAR gets toggled with the mouse press, so setting it directly should work. I'll let you know... First, I have to buy the full-up FSUIPC - my "project" for the day. Cheers, Dave
  12. OK, to suggest an answer to my own question, I expect I can make an FSUIPC mouse macro and assign it to a key without having to know what is in the gauge XML. But can I map directly to that g:pfd NavKnob pressed thing some way without having to make a macro? Or am I trying to hard to do something simple? -Dave
  13. I want to execute this "pfd NavKnob pressed" macro from the default G1000 gauge file with a key press. Here is an XML excerpt from the gauge file: <MouseArea id="Push"> <FloatPosition>20.000,58.000</FloatPosition> <Size>50,25</Size> <CursorType>Hand</CursorType> <MouseClick id="MouseClick"> <Script>1 (>@g:pfd NavKnob pressed, bool) (L:SelectedNav2) 1 == if{ 0 } els{ 1 } (>L:SelectedNav2) </Script> <ClickType>LeftSingle</ClickType> </MouseClick> </MouseArea> I think I read how to create my own macros, but how do you map to one that is already in the default gauge file? Thanks - I know it's a newbie question. The end goal is to execute this via serial com. -Dave
  14. Thanks for the reply Pete. I'll follow your suggestions, and will try to come up to speed on L:Vars. I wasn't looking at the FSUIPC drop down command lists, but rather the Event ID table from the SIMCONNECT SDK. The G1000-specific events (commends) has things like KEY_G1000_PFD_MENU_BUTTON for it's soft keys, but seems to use the "standard" NAV and COMM events (e.g. KEY_NAV1_RADIO_FRACT_INC) when the PFD tune controls are rotated. -Dave
  15. Hi, all. I've fooled with the Arduino and Link2PC, SIMCONNECT and VB, and now want to come up to speed on what looks like the Universal Tool. Here's what I am trying to do: tell me if you will whether the best/only way is via mouse macro. The default G1000 in the default FSX aircraft will change the NAV radio frequency select box (blue outline for frequency entry) when the G1000 PFD NAV 1-2 button is "pressed", and similarly for the COM 1-2 select. I can't find native SIMCONNECT commands that will do this (move the blue select box). Is this a case where there is no other way than to capture the mouse click? Thanks, Dave
  • 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.