using button with bit-mask

Forum Home Forums Understanding the Software Using Formulas using button with bit-mask

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12295
    asherb
    Participant

    hello,

    i want to have a button, when it is 0, press the button, it becomes 1. when it is 1, press the button, it becomes 0. However, the channel that linked to has used the bit mask, so the output formula is SetBit(DataRel(-1), 0, Cmd). I am wondering how i can apply formula to make this button to work.

    Thanks

    #12297
    Mikhail
    Moderator

    Hi,

    It should be something like
    SetBit(DataRel(-1), 0, Val() > 0 ? 0 : 1)

    The part Val() > 0 ? 0 : 1 gets the current channel data and reverses it. The above formula is not tested. This is only an idea.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.