Ankündigung

Einklappen
Keine Ankündigung bisher.

HS Logic-Hilfe benötigt

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

    HS Logic-Hilfe benötigt

    Hallo zusammen,

    leider musste ich feststellen, dass ich in Sachen Logicerstellen echt zu kämpfen habe. Vielleicht kann mir jemand weiterhelfen?

    Hier meine Aufgabe, die ich lösen möchte:
    Ich bekomme vom Bus zyklisch einen Zählwert gesendet. Ich würde gern die Differenz zwischen altem Wert und neuem Wert in ein internes KO speichern um diesen Wert anzuzeigen (auch wenn der Wert 0 ist, weil keine Änderung erfolgt ist).

    Beispiel 1: erster gesendeter Wert 10, zweiter Wert 13 -> zu speichernder Wert 3
    Beispiel 2: erster gesendeter Wert 10, zweiter Wert 10 -> zu speichernder Wert 0

    Ich bin leider völlig Lost, ggf. hat jemand das schon mal gelöst, oder eine Tipp für mich??

    Gruß Martin


    #2
    I solved a similar challenge using a sequencer.
    The logic would be as in the attachment.
    Test88 would be your Zählwert. The 'not equal' module will always output a '1' whenever a new Zählwert arrives at the input, as long as E2 has a value that your Zählwert will never have - I used '-99'. This then starts the sequencer.
    The next line of logic subtracts the values - Test95 is the new value, Test96 is the previous value. Test98 is your Differenz.
    The sequencer does this:
    Time 0: Set 'Calculation - Enable' to '1'.
    Time 1: Set Test95 to the value of Test88 (so, 'new value' to the value of Zählwert.
    This triggers the subtraction, and stores the value in GA Test98 (Differenz).
    Time 2: Set 'Calculation - Enable' to '0'. This prevents updating the Differenz when you update the previous value GA.
    Time 3: Set Test96 (previous value) to the value of Test88 (Zählwert). This then gets you ready for the next calculation.

    The 'previous value' should be retentive, so that the Differenz properly shows upon reboot and after the first Zählwert arrives.
    temp.jpg
    Hope this makes sense.
    Bram (Reply in German is fine)
    Angehängte Dateien

    Kommentar


      #3
      Zitat von bramlangen Beitrag anzeigen
      I solved a similar challenge using a sequencer.
      The logic would be as in the attachment.
      Test88 would be your Zählwert. The 'not equal' module will always output a '1' whenever a new Zählwert arrives at the input, as long as E2 has a value that your Zählwert will never have - I used '-99'. This then starts the sequencer.
      The next line of logic subtracts the values - Test95 is the new value, Test96 is the previous value. Test98 is your Differenz.
      The sequencer does this:
      Time 0: Set 'Calculation - Enable' to '1'.
      Time 1: Set Test95 to the value of Test88 (so, 'new value' to the value of Zählwert.
      This triggers the subtraction, and stores the value in GA Test98 (Differenz).
      Time 2: Set 'Calculation - Enable' to '0'. This prevents updating the Differenz when you update the previous value GA.
      Time 3: Set Test96 (previous value) to the value of Test88 (Zählwert). This then gets you ready for the next calculation.

      The 'previous value' should be retentive, so that the Differenz properly shows upon reboot and after the first Zählwert arrives.
      Hello Bram,

      Thank you for your help!! My task is solved with your help The idea of integrating a scene wouldn't come in my mind

      Best Regards Martin

      Kommentar

      Lädt...
      X