Jump to content
The simFlight Network Forums

Tom_G_2010

Members
  • Posts

    73
  • Joined

  • Last visited

Posts posted by Tom_G_2010

  1. I will be test driving LINDA this weekend to see what I can do with it. Additionally, Paul showed me how to pull a list of all the LVars from an add on, and I also trapped the above code using the logging functions in FSUIPC and lua.

    I have tested "GAUGE_ANUM_MASTER_CAUTION" setting it to both 1 and 0. As I thought it would it illuminates or extinguishes the warning lamp. However, the master caution system no longer functions properly after that absent that timer value that is set with "GAUGE_ANUM_MASTER_CAUTION_TIMER" That seems to determine how long the system waits before it rechecks the various systems that might trigger an alarm.

    So, the big mystery to solve, I think, is what programming, wizardry, or voodoo do I need to code in my lua script to calculate that timer value???

  2. Paul and Gunter, between the two of you and Pete I may actually get to the point where I have a clue about this lua stuff THANKS!!!!!!

    With the help the two of you have provided I have almost all my basic switch functions up and running on my King Air. This weekend I'll be baning my head agast the keyboard trying to figure out how Carnado implements timers in their code... http://forum.simflight.com/topic/72914-carenado-king-air-c90-switch-timers/

    Again, THANKS!

  3. I have been working on a script to bring as many of the panel switches on my Carenado King Air C90 out to my sim pit hardware as possible. I have a large number of them working but have hit road blocks on three or four of them. Those would be the Master Caution, Master Warning, Fuel Transfer Test, and Wiper Park switches. The first three have some type of timer in play and that is where this evenings head scratching is coming from... I'll tackle the Wiper Park after I get these timer based switches working . . .

    When I try to trap the LVars as I press the buttons in the cockpit view there seem to be four lines that always appear.


    370845 LUA.1: L:EX500_LocalTime=0.62591117011176
    370908 LUA.1: L:Time_Cont_car =3846
    370986 LUA.1: L:GAUGE_ANUM_MASTER_WARNING_TIMER=2265.2802124023
    371048 LUA.1: L:GAUGE_ANUM_MASTER_WARNING=0
    [/CODE]

    The first appears to check the current local time, it was shortly after 12:30am when I captured these log entries. The second line I'm not sure about at all. The third sets a timer value ( I assume a delay before the Master Warning system does another system check and re-illuminates (assuming alarm conditions still exist). And, the last line of code extinguishes the lamp. I get similar code for the Master Caution as well, and only a slight variation for the Fuel Transfer Test switch.

    At a point several log events later the Master Warning comes back on as expected since alarm conditions have not cleared

    [CODE]
    382935 LUA.1: L:GAUGE_ANUM_MASTER_WARNING=1
    [/CODE]

    Each time I click one of the switches I see a similar sequence only with the values progressively higher. Here's the click of the Master Caution that I did only a moment after the above

    [CODE]
    384932 LUA.1: L:EX500_LocalTime=0.62981561024984
    385010 LUA.1: L:Time_Cont_car =4099
    385073 LUA.1: L:GAUGE_ANUM_MASTER_CAUTION_TIMER=2279.2806396484
    385135 LUA.1: L:GAUGE_ANUM_MASTER_CAUTION=0
    [/CODE]

    [CODE]
    396944 LUA.1: L:GAUGE_ANUM_MASTER_CAUTION=1
    [/CODE]

    Has anybody seen this or maybe cracked the code? It would seem for me to be able to make these work on external switches I'll need to calculate that timing value and I can not figure out how it is arrived at.

    Thanks!

    Tom G.

  4. I am in the process of learning how to use lua scripting. I've been reading the doc's and reviewing several other users contributed scripts. I've written some basic scripts now myself. One function I have not figured out how to use properly is "ipcparam".

    I gathered from review of several other scripts and the documentation that it reads a parameter that is sent to a lua script and can be used in things like if/then/else statements. With that idea I wrote a variety of very simple test scripts. Here's one that I used:


    ipc.display("PARAM TEST START")
    ipc.sleep(2000)
    if ipcparam == 1 then
    ipc.display("PARAM 1")
    ipc.sleep(2000)
    elseif ipcparam == 2 then
    ipc.display("PARAM 2")
    ipc.sleep(2000)
    elseif ipcparam == nil then
    ipc.display("PARAM IS NULL")
    ipc.sleep(2000)
    else
    ipc.display("PARAM 1, 2, or NUL NOT DETECTED")
    ipc.sleep(2000)
    end

    ipc.display("PARAM TEST END")
    ipc.sleep(2000)
    [/CODE]

    What I'm not understanding is how to send the parameter to the script. After bouncing some ideas around with a more experienced script writer I did the following in hopes that this was the proper method.

    I assigned a button via FSUIPC to launch the above script (C90 TEST.lua) by selecting "[i]lua C90 TEST[/i]" in the "[i]Control sent when button pressed[/i]" drop down menu, and set the [i]Parameter[/i] entry for that button to [i]1[/i]. What I hoped to see, of course, was my displayed message of "[b]PARAM 1[/b]". That's not what happened though. No matter what I set the parameter value to 0, 1, 2, 3, etc. I got the "[b]PARAM IS NULL[/b]" message.

    So, obviously I'm not doing this right, or ipcparam reads values from some other source, or it is not intended for the purpose I thought it was.

    Any advice, direction, wisdom, or insight (or a dope slap) would be greatly appreciated.

    Tom G.

  5. Thanks Very Much for the explanation and sample scripts!

    I've got a long way to go on the lua learning curve, but you've certainly given me another push in the write direction. As of this morning I have many of the functions in my Carenado King Air C90 working thanks to your help. I'm still having trouble with a few they have that use timers, but thats not so much lua related as it is how Carenado has the application coded.

    Again Thanks!

    Tom G..

  6. Paul,

    If I might press you for just one more pointer. And, for this I have been reading the doc's and looking at other peoples scripts and I fear I'm just to thick headed for it to sink in. My question is with regard to the proper use of ipcparam and how to get FSUIPC to pass parameters to it, if in fact that is what it is for.

    I've been looking at several sample scripts and reviewing them against the lua documentation in an attempt tp better educate myself. I'm seeing a number of scripts that appear to use ipcparam to collect some form of parameter. Am I correct about that? And, if so, what settings in FSUIPC would be used to get a button to pass a parameter to a script such that ipcparam could then read it?

    Thanks!

    Tom G.

  7. I have been reading through the LUA library and other FSUIPC doc's to see if I can figure this out but so far it is eluding me.

    If I enter a parameter value for example "2" on a button assignment in FSUIPC, let's say Joy 3 button 21 and use that button to launch a LUA script, how do I read that parameter in my lua script?

    I am trying to write a common script to be used by several buttons and want to use if statements in the script to execute a variety of different actions based on the parameter value assigned to each button.

    If someone can point me in the right direction that would be great.

    Thanks!

    Tom G.

  8. Questions answered with a more thorough read of the lua doc's, study of other peoples scripts, and the help of another user via a different post.

    I've only attempted one other piece of programming with LUA so I'm still trying to figure things out and doing a great deal of head scratching. I'm writing a script to handle several of the switch functions on my Carenado King Air C90. Among the things I'm challenged by: I need to better understand how to read the state of an existing function; And, I need to get a better idea of how to capture switch actions using the logging function.

    Here are a couple examples wher I am trying to get physical switches on my sim pit panel:

    In this code which resides in with other code I am changing the state of the Transfer pump switch. However, under certain circumstances the code executes when the physical switch and the sim function are already in sync and it causes the sim switch to cycle or jump out of and back into the correct state. Can I use one of the "ipc.read_____" commands to determine the transfer pumps current state so I can bypass these lines of code when not needed?


    -- TRANSFER PUMPS
    if ipc.testbutton(3,3) == true then
    ipc.writeLvar("L:ASD_SWITCH_TRANS_PUMP_LEFT",2)
    elseif ipc.testbutton(3,3) == false then
    ipc.writeLvar("L:ASD_SWITCH_TRANS_PUMP_LEFT",1)
    end
    [/CODE]

    Here's a different example that I picked up from jbellardi's CAR_C90_CD.lua script. (a fantastic script by the way) That turns off the recognition lights by triggering the FSX "Toggle Recognition Lights" function.

    [CODE]
    RLI = logic.And(ipc.readUW(0x0D0C), 64)
    if RLI ~= 0 then
    ipc.control(66377)
    end
    [/CODE]

    My uneducated interpretation of this is that it is reading the condition of the recognition lights and if they are on it triggers the toggle function to turn them off. I would like to right a variation of this that accomplishes the reverse so I can place the two pieces of code in an "If then else" statement that reads my physical panel switch and if it is set to on and the lights are off, toggle them, conversely if the physical switch is set to on and they are already on do nothing.

    I have attempted all sorts of variations of the if RLI statement to see if I could figure out how to detect when the recognition lights where on, but no luck. I don't understand enough of what the output of that "logic.and" statement is to make it work. Any advice or direction would be greatly appreciated!

    I also suspect I could do much more of this myself if I better understood how to capture lua code related to specific action. I am capturing code in log files, be weeding through hundreds of lines to finds the secret formula is a bit more challenging than I thought it would be. IS there anyway to get a lua log to only capture events that result from an on screen action that I take such as clicking the Master Caution switch, or will I always need to decipher the required elements from the stream of code.

    Thanks in advance for any help!!!

    Tom G.

  9. 1. Is the window you want to position actually available to be moved? i.e. is it already undocked? The facility can only work on existing top-level windows -- it cannot actually create them. FS actually creates a new window when you undock. (I wish I could ffind a way of undocking them automatically, but I can't).

    Yes

    2. If so, do you have the name correct? "Main Panel" is the name normally given to the main 2D instrument panel. I think the window you want is called "Virtual Cockpt - View 00". Try that. It works here.

    Sorry about the "Main Panel" in my code example above. The correct code did read "Virtual Cockpit" I copied an the wrong text into the post above.

    However, having read your reply, I did find my error. It was not including the " - View 00" portion. I was under the mistaken impression that the view name had to only include the view's title and did not realize the it also required the numeric view identifier. All is working now.

    Thanks!

    Tom G.

  10. I may be misunderstanding the proper use of this lua code so I might be on a wild goose chase. Hope Not...

    In my sim setup I have two monitors. Monitor 1 is the primary and sits above monitor 2. The primary/top monitor (1) handles my out the window view and I display an undocked Virtual Cockpit on it taking up the entire screen. The second monitor (2) is were I run FSX with a docked view of the main instrument panel.

    32658063_f2st.png

    I found a code sample in the Example LUA Plugins file called "TileSix" that showed how to position undocked windows and I thought this might save me having to manually drag and size my undocked virtual cockpit view each time. Based on that sample I added the code line below to a lua script I called testVCposition.lua and assigned a button to launch it. When I press the buttoin, no change to my VC view occurs.

    Am I using this incorrectly, or not understanding its intended use?

    here's my tesVCposition.lua file


    ext.position("Main Panel", 1, 1, 99, 99, 1)
    [/CODE]

    here's the log from when I launch it:

    [CODE]
    ********* FSUIPC4, Version 4.853 by Pete Dowson *********
    User Name="Tom Gauvin"
    User Addr="xxxx@xxxx.xxx"
    FSUIPC4 Key is provided
    WideFS7 Key is provided
    322470 System time = 30/09/2012 00:03:54, Simulator time = 00:01:12 (04:01Z)
    [Continuation log requested by user]
    Running inside FSX on Windows 7
    Module base=59E70000
    329475 LUA.0: beginning "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules estVCposition.lua"
    329475 LUA.0: ...rosoft Flight Simulator X\Modules estVCposition.lua:1
    329475 LUA.0: Global: ipcPARAM = 0
    329475 LUA.0: ended "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules estVCposition.lua"
    614878 Sim stopped: average frame rate for last 292 secs = 18.3 fps
    620619 LogOptions changed, now 00000000 00000001
    [/CODE]

    If I can get this to work I would like to place it in my ipcready.lua file hoping it will position and size the window for me any time the aircraft is loaded and ready to fly.

  11. Pete,

    I am trying to use the FSUIPC logging feature to monitor and log some outputs from FSX. I've done so on many past occasions with no issues. However, this time when I use the "Send to console window" option the console window appears to flash on screen for a second and then it shrinks to a very small sliver on the screen that I can not seem to stretch or drag.

    Is there a setting in on of the FSUPC files that contains the default or last position of the console window that I might edit to resolve this?

    Thanks!

    Tom G.

  12. Second Followup:

    Pete, I was able to test the button functions through WideFS using a spare Bodnar card and all seems to be working as designed. I can send button functions from client to server without any issues. I also heard back from Alan about his FS2Phidget software and he confirmed that it does not function as a direct Input device or have a Dinput driver.

    While I don't have a Phidgets hardware device with button inputs, FS2Phidget does have an emulator function so I was able to test at least that much and there didn't appear to be any problems or conflicts. That emulator, of course, does not provide a sufficient test so I'll be looking at my budget to see if I can move the purchase of one up in the plan.

    Unfortunately, my weekend schedule has been changed and I won't have the time I was hoping for to do the house keeping on the pc software. I am hoping to do some of that during the upcoming week and will do further testing when done.

    So at this point it would appear, barring any problem with the future Phidget hardware test, that I have a working solution provided I launch the apps in the proper sequence. I will follow up again after I can perform the next round of testing.

    Thanks again for your assistance with this!!!

  13. Quick Followup:

    With ButtonScanInterval set to 0 the crash does not occur regardless of the start up sequence. I started everything up before leaving for work and almost two hours later all is still running. I think my next trouble shooting step might be to set ButtonScanInterval back to 20, use the WideClient first start up sequence and then find a way to test some functions that will be seen as a button input.

    Actually, looking back at your last reply, I will also have to go through the pc and make sure there are no joystick drivers or other bits of FSX related stuff left on there. It should all be clean now, but the pc I'm using has been my test bed for several FSX apps and add ons and as such may have some unwanted software remnants that I missed when uninstalling things. I'll do some further house cleaning this weekend and see what that gains me, and then move on to testing some button input scenarios.

  14. Well that's perfectly understandable. Most folks would have wideClient starting the applications using the "Run" options in the INI.

    Again I am sure it is much more the norm to have all the clients waiting for FS to be ready than the other way around. I'm surprised that you always waited for FS in the first place!

    Thanks. I'll take a look tomorrow. It's getting late here now!

    [LATER]

    Just a quick comment, from the details above. The crash is actually occurring in DINPUT.DLL, which is the DirectInput part of Windows. WideClient will be using that to scan for buttons to be sent to FS. Could it be that you have some old or unwanted joystick driver on that PC?

    Try setting "ButtonScanInterval=0" in the [Config] section of the INI. That'll stop WideClient trying. If that stops the crash, then that is what it is. Do Phidgets boards look like a Direct Input device or have a Dinput driver, perhaps? Maybe there's a clash between WideClient's attempts to read things and FS2Phidget's, but when FS2Phidgets gets in first, as it would if you have it all waiting till FSX is started, the clash doesn't happen because FS2Phidgets has initialised things correctly?

    Regards

    Pete

    Regards

    Pete

    Pete,

    Thanks for the clarification on sequence. I'm new to WideFS and for some reason thought I should have the server up before the Client. Regarding the Button Scan edit, I'll give that a try and let you know what I find. I'll also see if I can get Allan's attention to ask for clarification on how FS2Phidget functions with regard to Direct Input or use of a Dinput driver.

    Tom G.

  15. Pete,

    Sorry I missed that typo this morning. That's what I get for trying to edit code before having my first cup of coffee. This evening I corrected the typo and launched the client with the "debug all" active.

    I attempted different sequences for launching FSX/WideServer, WideClient, and FS2Phidget. I found that FS2Phidget has to be launched after WideClient or it does not see the FSX connection.

    I did find one sequence where WideClient seems to keep running: If I launch WideClient, then Fs2Phidget, and third launch FSX/WideServer all seems to work as expected. I have had all three running launched in that sequence for about 20 minutes now without any issues.

    However, if I launch FSX/WideServer then the WideClient followed by FS2Phidget, WideCLient will crash about a minute after FS2Phidget runs.

    The detailed log showing what happened when it crashed is attached. WideClient Log While Connected to FSX.zip The client crashed as before after about a minute of run time.

    Here's what came up in the Windows Event Viewer:


    Log Name: Application
    Source: Windows Error Reporting
    Date: 3/15/2012 6:36:28 PM
    Event ID: 1001
    Task Category: None
    Level: Information
    Keywords: Classic
    User: N/A
    Computer: TandJTabletPC
    Description:
    Fault bucket 2884856222, type 1
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0
    Problem signature:
    P1: WideClient.exe
    P2: 6.9.5.3
    P3: 4f594fa2
    P4: DINPUT.DLL
    P5: 6.1.7600.16385
    P6: 4a5bd9c0
    P7: c0000005
    P8: 00013f1d
    P9:
    P10:
    Attached files:
    C:\Users\Tom and Judy\AppData\Local\Temp\WER6061.tmp.WERInternalMetadata.xml
    These files may be available here:
    C:\Users\Tom and Judy\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_WideClient.exe_411bba4d0d15b94f38d93c0cb94ce5684d7c93_0335b4a8
    Analysis symbol:
    Rechecking for solution: 0
    Report Id: 40470422-6eef-11e1-912f-e02a822e11da
    Report Status: 0
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Windows Error Reporting" />
    <EventID Qualifiers="0">1001</EventID>
    <Level>4</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2012-03-15T22:36:28.000000000Z" />
    <EventRecordID>308583</EventRecordID>
    <Channel>Application</Channel>
    <Computer>TandJTabletPC</Computer>
    <Security />
    </System>
    <EventData>
    <Data>2884856222</Data>
    <Data>1</Data>
    <Data>APPCRASH</Data>
    <Data>Not available</Data>
    <Data>0</Data>
    <Data>WideClient.exe</Data>
    <Data>6.9.5.3</Data>
    <Data>4f594fa2</Data>
    <Data>DINPUT.DLL</Data>
    <Data>6.1.7600.16385</Data>
    <Data>4a5bd9c0</Data>
    <Data>c0000005</Data>
    <Data>00013f1d</Data>
    <Data>
    </Data>
    <Data>
    </Data>
    <Data>
    C:\Users\Tom and Judy\AppData\Local\Temp\WER6061.tmp.WERInternalMetadata.xml</Data>
    <Data>C:\Users\Tom and Judy\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_WideClient.exe_411bba4d0d15b94f38d93c0cb94ce5684d7c93_0335b4a8</Data>
    <Data>
    </Data>
    <Data>0</Data>
    <Data>40470422-6eef-11e1-912f-e02a822e11da</Data>
    <Data>0</Data>
    </EventData>
    </Event>
    [/CODE]

  16. I could do with a fuller log from WideClient. Could you do this please:

    1. Replace WideClient.exe with version 6.953, from the Download Links subforum -- so that we are both using the same version, and

    Replaced as requested

    2. Edit the WideClient.INI file, changing the Log option to "Log=DebugAll" in the [user] section, or add

    [user]

    Log=DebgAll

    edited as follows:


    [Config]
    ButtonScanInterval=20
    ClassInstance=0
    NetworkTiming=5,1
    MailslotTiming=2000,1000
    PollInterval=2000
    Port=8002
    Port2=9002
    ResponseTime=18
    ApplicationDelay=0
    TCPcoalesce=No
    WaitForNewData=500
    MaxSendQ=100
    OnMaxSendQ=Log
    NewSendScanTime=50
    Priority=3,1,2
    Window=75,81,601,493
    [Sounds]
    Path=C:\WideCLient_2\Sound\
    Device1=Primary Sound Driver
    Device2=Speakers / HP (IDT High Definition Audio CODEC)
    Device3=Headphones (RTC) (IDT High Definition Audio CODEC)
    [User]
    Log=DebgAll
    [/CODE]

    I launched WideClient and then FS2Phidget 4.3.66. After about 60 seconds the crash occurred having done nothing in FSX or FS2Phidgets.

    Here's the resulting log

    [CODE]
    ********* WideClient Log [version 6.953] Class=FS98MAIN *********
    Date (dmy): 15/03/12, Time 06:47:56.840: Client name is TANDJTABLETPC
    234 LUA: "C:\WideCLient_2\Initial.LUA": not found
    234 Attempting to connect now
    765 Server = HP410_KITCHENPC
    827 Trying TCP/IP host "HP410_KITCHENPC" port 8002 ...
    827 ... Okay, IP Address = 192.168.1.5
    843 Connection made okay!
    858 Connection closed by server!
    858 Attempting to connect now
    858 Trying to locate server: Need details from Server Broadcast
    5772 Server = HP410_KITCHENPC
    5772 Trying TCP/IP host "HP410_KITCHENPC" port 8002 ...
    5772 ... Okay, IP Address = 192.168.1.5
    5772 Connection made okay!
    9969 New Client Application: "FS2Phidget" (Id=1424)
    [/CODE]

    if there's no [user] section at present.

    This will make quite a big log. If the same crash does not occur with this setting, try again changing the Log option to "[b]Log=Yes[/b]" which will merely log whatever the FS2Phidget app is doing.

    For large logs, Zip them and send to me at petedowson@btconnect.comn. Otherwsie paste them here as before.

    When you run the FS2Phidgets program, does it get to do anything before the crash? Would I be able to reproduce it here with no Phidgets hardware?

    Regards

    Pete

    I thought at first the crash only occurred after I ran FSX functions that were monitored by FS2Phjidget but that appears not to be the case. If I launch the app and simple wait long enough (about 60 seconds) the crash occurs. As such I suspect you may be able to reproduce the event. I am running Win7 64Bit on both the server and client pc's. Please let me know of any further information I might provide.

    Is there any error trapping log in the Win 7 OS that might provide further clues???

    I'm headed to work now so my be somewhat delayed before responding next but will reply back as soon as possible.

    Thanks!

    Tom G.

  17. Pete,

    I've been using FSUIPC4 (registered) for some time now on my sim pc with FSX. Just yesterday I loaded the latest version and added a registration for WideFS. I loaded the WideClient on another PC. The first app I'm using this for is Allen Dyers FS2Phidgets V4 to drive some Phidget I/O cards for LEDs and Servos.

    All went well yesterday, in fact great. FS2Phidget connected through WideFS/FSUIPC to FSX and worked well. After work today I went to resume my efforts and am running into a windows error with the client app. It boots and connects right away as expected. But, within about 60 seconds of launching the FS2Phidget app, WideClient stops working and a windows error pops up stating "FS Eliminator for FSUIPC client application has stopped working".

    The only other app I have installed on my second pc at the moment that would take advantage of WideFS is a demo of one of the GA panels from Project Magenta. It seems to run fine WideClient stays up. It appears to only be when I load the FS2Phidget App that it crashes. As such I suspect that app is the source of the problem and will be reaching out to the developer for assistance, but thought it might be wise to check with you as well in case you had seen this before or had any thoughts on trouble shooting the issue.

    Thanks in advance!

    Tom G.


    [Config]
    ButtonScanInterval=20
    ClassInstance=0
    NetworkTiming=5,1
    MailslotTiming=2000,1000
    PollInterval=2000
    Port=8002
    Port2=9002
    ResponseTime=18
    ApplicationDelay=0
    TCPcoalesce=No
    WaitForNewData=500
    MaxSendQ=100
    OnMaxSendQ=Log
    NewSendScanTime=50
    Priority=3,1,2
    [Sounds]
    Path=C:\WideClient\Sound\
    Device1=Primary Sound Driver
    Device2=Speakers / HP (IDT High Definition Audio CODEC)
    Device3=Headphones (RTC) (IDT High Definition Audio CODEC)
    [/CODE]

    [CODE]
    ********* WideClient Log [version 6.94] Class=FS98MAIN *********
    Date (dmy): 14/03/12, Time 20:25:56.241: Client name is TANDJTABLETPC
    219 LUA: "C:\WideClient\Initial.LUA": not found
    234 Attempting to connect now
    1248 Trying to locate server: Need details from Server Broadcast
    1248 Failed to connect: waiting to try again
    3261 Attempting to connect now
    13369 Server = HP410_KITCHENPC
    13385 Trying TCP/IP host "HP410_KITCHENPC" port 8002 ...
    13385 ... Okay, IP Address = 192.168.1.5
    13416 Connection made okay!
    18049 New Client Application: "FS2Phidget" (Id=1068)
    [/CODE]

    [CODE]
    ********* WideServer.DLL Log [version 7.81] *********
    Blocksize guide = 8192 (double allowed)
    Date (dmy): 14/03/12, Time 20:25:51.073: Server name is HP410_KITCHENPC
    15631 Initialising TCP/IP server
    15631 Initialising UDP/IP server
    16130 Broadcasting service every 1000 mSecs
    16707 Incoming connection Accepted ok (skt=11412) TCP
    17066 Connected to computer "TANDJTABLETPC" running WideClient version 6.940 (skt=11412) TCP
    47143 Restarting service due to zero reception!
    89576 Closing down now ...
    Memory managed: Offset records: 129 alloc, 128 free
    Read buffer usage: 11 alloc, 11 free, max in session: 1
    Write buffer usage: 1172 alloc, 1172 free, max in session: 1
    Throughput maximum achieved: 19 frames/sec, 640 bytes/sec
    Throughput average achieved for complete session: 3 frames/sec, 91 bytes/sec
    Average receive rate from "TANDJTABLETPC": 0 frames/sec, 6 bytes/sec
    ********* Log file closed *********
    [/CODE]

    [CODE]
    ********* FSUIPC4, Version 4.81 by Pete Dowson *********
    User Name="Xxx Xxxxxx"
    User Addr="xxx@xxxxxxxxxx.xxx"
    FSUIPC4 Key is provided
    WideFS7 Key is provided
    Running inside FSX on Windows 7
    Module base=61000000
    764 System time = 14/03/2012 20:24:44
    780 FLT UNC path = "\\HP410_KITCHENPC\Users\Flight Sim\Documents\Flight Simulator X Files\"
    827 Trying to connect to SimConnect Acc/SP2 Oct07 ...
    827 FS UNC path = "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\"
    1264 LogOptions=00000000 00000001
    1264 Wind smoothing fix is fully installed
    1264 G3D.DLL fix attempt installed ok
    1264 SimConnect_Open succeeded: waiting to check version okay
    1264 Trying to use SimConnect Acc/SP2 Oct07
    5429 Running in "Microsoft Flight Simulator X", Version: 10.0.61637.0 (SimConnect: 10.0.61259.0)
    5429 Initialising SimConnect data requests now
    5429 FSUIPC Menu entry added
    5491 \\HP410_KITCHENPC\Users\Flight Sim\Documents\Flight Simulator X Files\KTRG BONANZA.FLT
    5491 C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\Carenado BONANZA V35B\Carenado_V35.AIR
    6880 Weather Mode now = Global
    24289 C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\C172\Cessna172SP.AIR
    52401 Aircraft="Cessna Skyhawk 172SP Paint2"
    52416 System time = 14/03/2012 20:25:35, Simulator time = 20:24:48 (01:24Z)
    67689 Starting everything now ...
    67720 Advanced Weather Interface Enabled
    75177 Weather Mode now = Theme
    75614 Weather Mode now = Global
    144972 Sim stopped: average frame rate for last 81 secs = 20.8 fps
    159620 System time = 14/03/2012 20:27:23, Simulator time = 20:26:09 (01:26Z)
    159620 *** FSUIPC log file being closed
    Average frame rate for running time of 82 secs = 20.8 fps
    G3D fix: Passes 15694, Null pointers 0, Bad pointers 0, Separate instances 0
    Memory managed: 129 Allocs, 129 Freed
    ********* FSUIPC Log file closed ***********
    [/CODE]

  18. I'm thinking of providing the code as one of the samples in the Lua plug-ins package. Should I change the timing in that do you think? I assume you mean this line:

    FastTimeLimit = 60 -- Adjust to taste

    Better at 100?

    Thsnks,

    Pete

    Pete,

    I've been doing some more experimenting back and forth in a range between 80 and 100. I found 70 too short, and a bit more experimentation is showing me that 100 may be a bit long as it occasionally catches a tail end click as a fast when I'm slowing down to zero in in a specific heading.

    I would go with 90 as a starting point.

    Tom G.

  19. THAT'S DONE IT! ALL IS WORKING NOW!! biggrin.gif

    Then we need to find other postings of the code and correct those. Can you tell me the source you found, please?

    Pete, the Code came from post #25 of this thread, your 14 June 2011 - 06:58 AM reply post

    I had a little bit of a time getting the fast timing limit set to trigger fast movement, but did get it. I threw in some logging lines to show me the time difference when the if statement triggered and experimented until I had a comfortable timing. It's at 100 now but that's on the test bench so I may fine tune that further when I get the encoders installed in the real panel and as I gain experience.

    THANKS!!! For all your help and patience.

    Tom G.

  20. I've removed the button assignment that launched the HIDDemo from the FSUIPC config and added the "IgnoreThese = 3.31, 3.30" back in. I also removed the HIDDemo and IPCDebug scripts from the modules folder.

    I re-launched FSX and repeated the test of two clicks ccw and two clicks cw. No change, still only decrimenting with ccw and no action with cw. The IPCReady log and FSUIPC log are below.

    I may try to place a couple other log statements in to look at some of the other variables to see if I can understand more of the script myself.

    Any further thoughts?

    ********* LUA: "ipcReady" Log [from FSUIPC version 4.734] *********
        30248 System time = 11/10/2011 18:11:58, Simulator time = 18:11:32 (22:11Z)
        30248 LUA: beginning "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\ipcReady.lua"
        34913 LUA: Datalength=6 Buttons=1073741824 PrevButtons=0
        34944 LUA: Datalength=6 Buttons=1073741824 PrevButtons=1073741824
        34975 LUA: Datalength=6 Buttons=0 PrevButtons=1073741824
        36285 LUA: Datalength=6 Buttons=1073741824 PrevButtons=0
        36317 LUA: Datalength=6 Buttons=1073741824 PrevButtons=1073741824
        36348 LUA: Datalength=6 Buttons=1073741824 PrevButtons=1073741824
        36379 LUA: Datalength=6 Buttons=0 PrevButtons=1073741824
        37892 LUA: Datalength=6 Buttons=2147483648 PrevButtons=0
        37923 LUA: Datalength=6 Buttons=2147483648 PrevButtons=2147483648
        38001 LUA: Datalength=6 Buttons=0 PrevButtons=2147483648
        39218 LUA: Datalength=6 Buttons=2147483648 PrevButtons=0
        39265 LUA: Datalength=6 Buttons=2147483648 PrevButtons=2147483648
        39296 LUA: Datalength=6 Buttons=2147483648 PrevButtons=2147483648
        39327 LUA: Datalength=6 Buttons=0 PrevButtons=2147483648
        49733 LUA: ended "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\ipcReady.lua"
        49733 System time = 11/10/2011 18:12:17, Simulator time = 18:11:46 (22:11Z)
    ********* LUA execution terminated: Log Closed *********

    ********* FSUIPC4, Version 4.734 by Pete Dowson *********
    User Name="Tom Gauvin"
    User Addr="tom@thegauvins.com"
    FSUIPC4 Key is provided
    WIDEFS7 not user registered, or expired
    Running inside FSX on Windows 7
    Module base=61000000
    Wind smoothing fix is not installed
    DebugStatus=15
          546 System time = 11/10/2011 18:11:28
          546 FLT path = "C:\Users\Tom and Judy\Documents\Flight Simulator X Files\"
          592 Trying to connect to SimConnect Acc/SP2 Oct07 ...
          592 FS path = "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\"
     	1138 LogOptions=E0000000 0000001D
     	1138 SimConnect_Open succeeded: waiting to check version okay
     	1138 Trying to use SimConnect Acc/SP2 Oct07
     	3868 Running in "Microsoft Flight Simulator X", Version: 10.0.61637.0 (SimConnect: 10.0.61259.0)
     	3868 Initialising SimConnect data requests now
     	3868 FSUIPC Menu entry added
     	3915 Ready Flags: Ready-To-Fly=N, In Menu=Y, In Dlg=Y
     	3915 C:\Users\Tom and Judy\Documents\Flight Simulator X Files\KTRG 172.FLT
     	3915 C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\C172\Cessna172SP.AIR
     	4040 *** EVENT: Cntrl= 66416 (0x00010370), Param= -1 (0xffffffff) PAN_VIEW
        13369 *** EVENT: Cntrl= 66514 (0x000103d2), Param= 0 (0x00000000) ATC_MENU_CLOSE
        29219 Ready Flags: Ready-To-Fly=N, In Menu=N, In Dlg=N
        30061 System time = 11/10/2011 18:11:57, Simulator time = 18:11:32 (22:11Z)
        30077 Aircraft="Cessna Skyhawk 172SP Paint2"
        30248 Starting everything now ...
        30264 Ready Flags: Ready-To-Fly=Y, In Menu=N, In Dlg=N
        34944 WRITElua 3340,   1 bytes: 01                                           	.
        34944 Button changed: bRef=0, Joy=64, Btn=0, Pressed
        34944 [Buttons] 51=P64,0,C65880,0
        34944 FS Control Sent: Ctrl=65880, Param=0
        34944 *** EVENT: Cntrl= 65880 (0x00010158), Param= 0 (0x00000000) HEADING_BUG_DEC
        35006 WRITElua 3340,   1 bytes: 00                                           	.
        35006 Button changed: bRef=0, Joy=64, Btn=0, Released
        35006 [Buttons] 52=U64,0,C65880,0
        35006 FS Control Sent: Ctrl=65880, Param=0
        35006 *** EVENT: Cntrl= 65880 (0x00010158), Param= 0 (0x00000000) HEADING_BUG_DEC
        36317 WRITElua 3340,   1 bytes: 01                                           	.
        36317 Button changed: bRef=0, Joy=64, Btn=0, Pressed
        36317 [Buttons] 51=P64,0,C65880,0
        36317 FS Control Sent: Ctrl=65880, Param=0
        36317 *** EVENT: Cntrl= 65880 (0x00010158), Param= 0 (0x00000000) HEADING_BUG_DEC
        36410 WRITElua 3340,   1 bytes: 00                                           	.
        36410 Button changed: bRef=0, Joy=64, Btn=0, Released
        36410 [Buttons] 52=U64,0,C65880,0
        36410 FS Control Sent: Ctrl=65880, Param=0
        36410 *** EVENT: Cntrl= 65880 (0x00010158), Param= 0 (0x00000000) HEADING_BUG_DEC
        45037 *** EVENT: Cntrl= 65732 (0x000100c4), Param= 0 (0x00000000) EXIT
        45177 Ready Flags: Ready-To-Fly=Y, In Menu=Y, In Dlg=Y
        51261 System time = 11/10/2011 18:12:19, Simulator time = 18:11:46 (22:11Z)
        51261 *** FSUIPC log file being closed
    Average frame rate for running time of 16 secs = 29.8 fps
    Memory managed: 25 Allocs, 25 Freed
    ********* FSUIPC Log file closed ***********

  21. So, something else -- another Lua program -- is writing to the same virtual button offsets at the same time, but using buttons 30 and 31 instead of your 0 and 1. This is interacting with your Lua inputs and so destroying some of the results. And stopping the rotary one working.

    I'll go back through everything this evening and make sure there aren't any other lua scripts in modules folder. There should not be anything beyond IPCReady, IPCDebug, and HIDDemo since I've never used lua before, but I'll make sure.

    i notice this in your FSUIPC button assignments:

    74=U2,2,CL2:K,0

    This appears to be running a Lua program, number 2 in the list in the INI file (which you omitted). And you are pressing that button and getting that Lua running just before you do the test:

    41980 Button changed: bRef=0, Joy=2, Btn=2, Pressed

    41980 [buttons] 27=P2,2,CL2:R,0

    Why? What is this you are doing?

    Pete

    That was how I launched the HidDemo lua script based on one of your earlier posts. Since it seems that has now proven the buttons are sending correctly I'll assume I can stop using it. Tests this morning with or without HidDemo running still had no cw activity so I don't think it was interfering.

    While re-reading my post from this morning I also just noticed that I had not added one update line to the FSUIPC Config Buttons section that you also earlier suggested, "IgnoreThese=3.30, 3.31". I will add that back in and retest before posting again.

    One other quick question. Above you commented,

    "I should have put those numbers out in Hex, not Decimal. nevertheless they are correct, 0x40000000 and 0x80000000 respectively."

    How hard is it to modify the logging statement to do that? It would seem that would make it easier to follow.

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