Jump to content
Sign in to follow this  
Sky Flyer

Three-way switch logic

Recommended Posts

The way I have done this for my simpit is with 2 AAO commands. 

The first command is for the "up" position. This AAO command has the desired function on the button press "on" and the middle function of the switch on the button release "off".

The second command is for the "down" position. Again, The AAO command as the desired function on the button press "on" and the middle function of the switch on the button release "off".

There may be other ways that are more elegant, for example with a script, but this way works in my application.

 

Edited by hs118
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Sky Flyer said:

Hi! Any idea how best to make a three-way switch on the a320? Thanx !

What simulator?
What switch in which A320?
For what kind of external control? Momentary button on a yoke, switch on a switchbox, StreamDeck?

Edited by Lorby_SI
  • Upvote 1

LORBY-SI

Share this post


Link to post
Share on other sites

Thanks for answers ! I use x-touch mini - I have no problems with it. Now I'm trying to set up Streamdeck XL - no problems with toggle and two way buttons, but I can't figure out how to cycle through 3 values. prepar3d 5.3 simulator, fslabs.

Share this post


Link to post
Share on other sites
1 hour ago, Sky Flyer said:

Thanks for answers ! I use x-touch mini - I have no problems with it. Now I'm trying to set up Streamdeck XL - no problems with toggle and two way buttons, but I can't figure out how to cycle through 3 values. prepar3d 5.3 simulator, fslabs.

This must be done with RPN scripts. The actual script code depends on what that switch is supposed to do, there is no generic solution. Cycle an LVar through 3 values? Trigger a K-Event with three different values? Something else entirely?

  • Upvote 1

LORBY-SI

Share this post


Link to post
Share on other sites

I tried to write 3 values through LVAR , but the switch position changes only visually, without triggering the event. I do not quite understand how to do the same through K-rotors. The command must depend on the actual starting position of the switch.

Share this post


Link to post
Share on other sites
37 minutes ago, Sky Flyer said:

...but the switch position changes only visually, without triggering the event.

Which switch??

Share this post


Link to post
Share on other sites
44 minutes ago, Sky Flyer said:

I tried to write 3 values through LVAR , but the switch position changes only visually, without triggering the event. I do not quite understand how to do the same through K-rotors. The command must depend on the actual starting position of the switch.

As @Noncon says: we need to know EXACTLY what you are trying to do. There is no generic approach. 

This is potentially different for every switch (and every aircraft - and every sim). 


LORBY-SI

Share this post


Link to post
Share on other sites
1 hour ago, Sky Flyer said:

I tried to write 3 values through LVAR , but the switch position changes only visually, without triggering the event

That is quite normal. LVars traditionally control (only) the animation.

I'm not sure what kind of logic the FSLabs A320 uses or if it has an SDK/API (I think that it doesn't). But your answer suggests that it uses the ROTOR_BRAKE event somehow. So your script would have to read the LVar, which will give you the current position of the switch. Depending on that value you send the appropriate ROTOR_BRAKE event. 

I don't own the FSLabs myself, so I can only guess. Assuming (= not actually knowing) that the LVar goes through 0, 1, 2 for the three positions, you make one script like this

(L:whatever, Number) 0 == if{ whatever_gets_the_switch_to_position_1 (>K:ROTOR_BRAKE) } 
(L:whatever, Number) 1 == if{ whatever_gets_the_switch_to_position_2 (>K:ROTOR_BRAKE) } 
(L:whatever, Number) 2 == if{ whatever_gets_the_switch_to_position_0 (>K:ROTOR_BRAKE) } 

Or something like that.

Edited by Lorby_SI
  • Like 1

LORBY-SI

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...