how to pass a value under a condition?

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #1

    how to pass a value under a condition?

    Hello,

    I am trying to program the following situation. Consider two values A and B.
    How can I pas some analogue value C (when C changes), but only if A=B?

    An analog memory works on the rising edge of the trigger, but A nor B changes value...

    Thanks!
  • Christian Fenzl
    Lebende Foren Legende
    • 31.08.2015
    • 11234

    #2
    An analog output always has a value.

    If A EQUAL B condition to the S input of an Analog Selector block. By the S (Select) input you switch between 0 and C.
    Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

    Kommentar


    • Christian Fenzl
      Christian Fenzl kommentierte
      Kommentar bearbeiten
      PS: Not tried, but if you connect a Memory to the output of the Analog Selector, and input this Memory to the first input of the Analog Selector, you may have saved the last value.

    • J V
      J V kommentierte
      Kommentar bearbeiten
      Yes, this works! I tried with an EIB switch and a +/- selector. Flip the switch one way, and the +/- selector's value is passed through the multiplexer. Flip the switch the other way and the old value is kept no matter what happens to +/- selector. Flipping the switch back immediately passes the current value of the +/- selector.
      Perfect!
      Thanks!!!

    • J V
      J V kommentierte
      Kommentar bearbeiten
      Just to confirm: it also works in the situation where I need it, so not just in the artificial example.
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #3
    Zitat von Christian Fenzl
    If A EQUAL B condition to the S input of an Analog Selector block. By the S (Select) input you switch between 0 and C.
    The thing is: I don't want to switch between 0 and C, but between the "new" value of C and the old value of C.

    C changes ---- if A==B---> pass new value
    C changes ---- if A<>B---> keep old value

    I'll try your approach with the memory and the selector... seems like it might work... I'll report back :-)
    Thanks!

    edit: the approach works!
    Zuletzt geändert von J V; 17.10.2020, 19:28.

    Kommentar

    Lädt...