Results 1 to 8 of 8
  1. #1
    25+ Posting Member matta757's Avatar
    Join Date
    Nov 2009
    Location
    Minneapolis, Minnesota, USA
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Help with Rotaries and FSX

    Hi Nico,

    I have some questions for you that have been keeping me perplexed. I am in the process of transitioning from FS9 to FSX. I have been using Lekseecon with FSUIPC in FS9 for a long time and it works like a dream. So thank you for such a great program. But as I am trying to move things from FS9 to FSX and transfer over the coding, I am running into issues with the state of my rotary switches.

    My setup is somewhat unique, my rotary switches are actually connected to FS as AXIS inputs, not button inputs. There is a long and complicated story as to why I did this that I will not delve into. Suffice to say, I have stuck with keeping these switches as AXIS inputs because it opens up more options for other buttons and switches. I setup these axes using Ian's guide to making a rotary switch into a potentiometer and have them setup in FSUIPC as button controls under the AXIS ASSIGNMENT page. See the attached picture.

    example2.jpg

    This is the L PACK switch. Whenever the pot (rotary switch) is within the range defined in FSUIPC, it writes to the assigned offset, at least that is my understanding. When it leaves that range, I think I have it clearing that offset. I was not entire sure what I was doing when assigning the Offset Byte Togglebits and Offset Byte Clrbits commands, but they work within FS9 without any problems. It's FSX now that has the issue.

    This setup has been working remarkably well in FS9. When I open Lekseecon, it connects just fine and all the switches go to their proper states, with no error messages. But now when I try to use the same FSUIPC setup within FSX, the state of the switches does not reflect the true position of the hardware. Once I start moving the switches on my panels, they sync up just perfectly with the simulation, but it's the initial startup positions that are not setting correctly. The PACKS, PAX SIGNS, and APU switches all default to an incorrect position and I get a whole host of errors in the Lekseecon log file saying that there is no initial value received. I cannot seem to solve this problem no matter how what I try.

    Do you have any idea what might be wrong? What other information do you need from me in order to better understand what's going on? I appreciate any help you can provide. Again, thank you for all your wonderful contributions to the 767 building community.

    Best regards,
    Matt
    Attached Images Attached Images

  2. #2
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,198
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Hi Matt,

    Thank you for your kind words, I'm glad lekseecon is of use to you.

    I had not heard of Ians AXIS 'trick' before, but it is indeed a nice solution, although I think it is better to use Offset Byte SetBits instead of Offset Byte Togglebits. When you enter the range it will set the bit and when you leave the range it will be cleared and another bit (of the new range) will be set. So you will always have one bit set (which is also the case with a real rotary switch). That might solve your initialisation issue.

    Why it worked in FS9 and not in FSX I don't know, but do know that FSUIPC works (Under the Hood) quite different in FSX while it has to deal with the new MS Simconnect.

    So try to change each rotary switch position definition into Offset Byte Setbits (there will be quite a lot ...)

    Best regards,
    Nico

  3. #3
    25+ Posting Member matta757's Avatar
    Join Date
    Nov 2009
    Location
    Minneapolis, Minnesota, USA
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Hi Nico,

    Thanks for the reply. That all makes sense. I will give it a try with FSX and see what happens.

    On another note, you mentioned using Offset Byte SetBits instead of ToggleBits, but when I do that with FS9, it does not work properly. The switches move irradically and don't reflect my hardware state. I found that using ToggleBits and setting it to 1 when the range is entered and setting ClrBits to 1 when leaving the range was the only way to make it work. Any ideas why that might be?

    I also just got a real APU switch out of a 767 simulator and am having some trouble figuring out how to set it because the switch itself only has 2 positions wired, and that's ON and START. The OFF position on the switch has no actual output. So when I try to program it using Lekseecon, I can't find a way to write a 1 to the offset for APU off, so the switch never turns to off. Any idea how to deal with this problem?

    Thanks again,
    Matt

  4. #4
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,198
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Quote Originally Posted by matta757 View Post
    Any ideas why that might be?
    No I have not, sorry. I'm not using FSUIPC...


    Quote Originally Posted by matta757 View Post
    I can't find a way to write a 1 to the offset for APU off, so the switch never turns to off. Any idea how to deal with this problem?
    If On = 0 and Start =0 the switch will be in the OFF position. With cockpit building software such as SIOC it is very easy to write a script for it, but in basic FSCUIPC I don't think it is possible. Maybe you can use FSUIPC extensions such as Lua or use Linda.

    Rgrds,
    Nico

  5. #5
    25+ Posting Member matta757's Avatar
    Join Date
    Nov 2009
    Location
    Minneapolis, Minnesota, USA
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Ok, thanks anyway.

    I did some checking on how I assigned my switches, and I had to do Offset Byte Clrbits when the button is released for every single switch assignment, otherwise the switch will not set correctly. I know you don't use FSUIPC, but have you ever heard of having to do this? It makes sense that what you're saying is that when the button is engaged, FSUIPC should write a 1 to the offset and that when it's released, it should be a 0, but for me this does not seem to be the case.

    Thanks again for your help, maybe I'll have a go at SIOC again (although last time I tried I was completely lost...).

    Matt

  6. #6
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,198
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Quote Originally Posted by matta757 View Post
    I know you don't use FSUIPC, but have you ever heard of having to do this?
    Does not seem strange to me. The rotary switch mechanism in lekseecon works as follows: each time a 1 in an offset is set, lekseecon will set the switch in the Level-D to that position. When you clear the bit is not that important, but it has to be cleared before you want to set the same bit again ... So you can very well set a 1 in offset A, then a 1 in Offset B, then clear both offstes and continue with a new bit 1 in offset A. There's one pitfall, at start-up time one, and only one of the offsets must contain a 1.

    Part of your problems are because you do not use a real rotary switch. Thanks to its mechanical construction it is always guarenteed that always only one terminal is active.

    Quote Originally Posted by matta757 View Post
    Thanks again for your help, maybe I'll have a go at SIOC again (although last time I tried I was completely lost...).
    That would be a wise step, and an investment that will pay off at the end of the day

    If you want to build a cockpit that is more than a few switches, you definitely need hard- and software that is developed for building flightsim cockpits.

    Nico

  7. #7
    25+ Posting Member matta757's Avatar
    Join Date
    Nov 2009
    Location
    Minneapolis, Minnesota, USA
    Posts
    37
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Nico,

    In my last post, I was actually referring to my other switches (including rotary switches that are wired as such) and not the rotaries that are wired as pots. With every switch, including the rotaries, I needed to use the clrbits function.

    I have been looking into various options like Arduino as well as SIOC.

    Matt

  8. #8
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,198
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Help with Rotaries and FSX

    Hi Matt,
    Quote Originally Posted by matta757 View Post
    In my last post, I was actually referring to my other switches (including rotary switches that are wired as such) and not the rotaries that are wired as pots.
    I see, but you still are using FSUIPC buttons for it, are you not?


    Quote Originally Posted by matta757 View Post
    I have been looking into various options like Arduino as well as SIOC.
    Arduino is a nice system, but not particularly targeted towards Flight Simming. You better use hard- and software that was designed for Flightsimming: e.g. Opencockpits...

    SIOC is an application language (Flight simming is the application).
    Open cockpits hardware is cheap and reliable, Opencockpits software (SIOC) is free, and very powerful. Besides that if you are using SIOC you can use lekseecon for SIOC which is easier to use than lekseecon for FSUIPC.
    (do note that I'm not working for Opencockpits, it's based on 10 years of experience).

    Nico