Toggle bit question

This Forum is designed to support and assist in the use of any/all FDS related Interface products.

Moderators: Curtis, Jetcos

Post Reply
neuman5022
Posts: 261
Joined: Fri Nov 25, 2005 9:15 pm
Location: Nelson NEW ZEALAND

Toggle bit question

Post by neuman5022 »

Hi Folks

Need your help again:


When updating an input task with PMsystems, after choosing the name I have 3 options: Set Bit, Clear bit (Which I understand) and "toggle bit". What does the Toggle bit do and when it is needed ?

Thanks

Isaac

mauriceb
Posts: 1051
Joined: Mon Aug 22, 2005 3:14 pm
Location: Gravenhurst, Ontario - Canada

Post by mauriceb »

Toggle means just what it says...if bit=0 change it to 1 and if bit=1 change it to 0. In other words, change the initial state to the opposite state.

Maurice

neuman5022
Posts: 261
Joined: Fri Nov 25, 2005 9:15 pm
Location: Nelson NEW ZEALAND

Post by neuman5022 »

Thanks Mo

It always looks so simple when you explain it :lol:

Cheers

Isaac

vidarf
Posts: 504
Joined: Fri May 12, 2006 11:37 am
Location: Narvik, Norway
Contact:

Post by vidarf »

With Mau, it HAS to be simple... :P

BTW, any examples for where this is actually used? Can't think of anything.

mauriceb
Posts: 1051
Joined: Mon Aug 22, 2005 3:14 pm
Location: Gravenhurst, Ontario - Canada

Post by mauriceb »

vidarf wrote:With Mau, it HAS to be simple... :P

BTW, any examples for where this is actually used? Can't think of anything.
Simple minds....simple explanations :)

My guess would be that they are used for push button switches (momentary or not) since you cannot tell what state they are in. So when you push the switch, you change the state of what the switch controls whatever it was. You could not use set bit or clear bit with a momentary switch for obvious reasons.

But of course this is what my simple mind believes. More enlightened minds may have a better or more complete explanation :)

Maurice

neuman5022
Posts: 261
Joined: Fri Nov 25, 2005 9:15 pm
Location: Nelson NEW ZEALAND

Post by neuman5022 »

Thanks for the info Mo.


Why can't a push button have set bit and clear bit ?


Some push buttons require to hold the button for a specific task - for example the test button on the LE devices of the 737 AFT OVHD. Pushing and holding will have the lights on, when releasing it will go off. In this case can I asign the set bit/clear bit ?


For other types of tasks - say horn cut-out or similar, maybe then then the clear bit has no meaning, but in some cases we can use the virtual toggle for push button option.

Hope someone will jump in for an example of where we need the toggle bit ???

Cheers


Isaac

mauriceb
Posts: 1051
Joined: Mon Aug 22, 2005 3:14 pm
Location: Gravenhurst, Ontario - Canada

Post by mauriceb »

neuman5022 wrote:Thanks for the info Mo.


Why can't a push button have set bit and clear bit ?


Some push buttons require to hold the button for a specific task - for example the test button on the LE devices of the 737 AFT OVHD. Pushing and holding will have the lights on, when releasing it will go off. In this case can I asign the set bit/clear bit ?


Isaac
Pushing a button is one action, releasing it is a different action and in your example, I guess you could use set bit/clear bit. But if you want the same action (pushing a button) to cause the opposite result every time you push the button, then you would need the toggle function.

Let's say you wanted to set an alarm by pushing a momentary push button and clear the alarm when you press that same button again then the toggle function would be required.

But anyway, why do you need to know where it is used in a cockpit? You can use the set bit/clear bit as long as it does what you need and I think it may become obvious if/when the toggle function is needed. Unless you are just curious and in that case, I can't help you since I have no idea either :D

Someone else will have to chime in here with a good use of the toggle function


Maurice

vidarf
Posts: 504
Joined: Fri May 12, 2006 11:37 am
Location: Narvik, Norway
Contact:

Post by vidarf »

Oh, oh, OH!! I KNOW, I KNOW, I KNOW!!! The clock button on the glare wings! :D
If the button on the clock itself is present, of course...

Dang, Mau - you HAVE to be impressed by that one! :D

mauriceb
Posts: 1051
Joined: Mon Aug 22, 2005 3:14 pm
Location: Gravenhurst, Ontario - Canada

Post by mauriceb »

vidarf wrote:Oh, oh, OH!! I KNOW, I KNOW, I KNOW!!! The clock button on the glare wings! :D
If the button on the clock itself is present, of course...

Dang, Mau - you HAVE to be impressed by that one! :D
Congratulations!. You may have found the one & only example :D. Steve might disagree though.

Maurice

vidarf
Posts: 504
Joined: Fri May 12, 2006 11:37 am
Location: Narvik, Norway
Contact:

Post by vidarf »

*proud* 8)

Post Reply