Ankündigung

Einklappen
Keine Ankündigung bisher.

how to pass a value under a condition?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • 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!

  • #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.
    LoxBerry/Plugin Support: Wenn du einen Begriff in meiner Antwort nicht auf Anhieb verstehst, bitte nicht gleich rückfragen, sondern erst die Suche im LoxWiki und bei Google bemühen.
    PN/PM: Ich bevorzuge die Beantwortung von Fragen in öffentlichen Threads, wo andere mithelfen und mitprofitieren können. Herzlichen Dank!

    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.

  • #3
    Zitat von Christian Fenzl Beitrag anzeigen
    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; vor einer Woche.

    Kommentar

    Lädt...
    X