detect value change

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

    #1

    detect value change

    Hello,

    I'm trying to use the outcome of "unequals" to trigger another block.
    The problem is that the output Q of unequals does not refresh if the inputs change as long as the condition is met: if they are still unequal, the output stays 1.

    Is there an easy way to detect if an analogue value changes?

    Thanks!
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #2
    Just to update...
    In the unequals block, A1 is the output of a state, whereas A2 is a constant. I don't have that many possible values for A1, so I currently changed it to multiple "equals" block (one for each possible value, except for the one previously in the unequals block), each of which connects to a multifunction switch with a short output-time setting. The outputs of these multifunction switches are connected to the block I want to trigger. Any change of A1 changes the equals block that is matched and thus generates a new trigger. Typing this makes me wonder if the multifunction switches are at all necessary.
    It is a bit cumbersome as I need that many equals blocks and constants for each output of the state, but I don't see another way to generate a trigger. Still, hope it helps someone. :-)

    Kommentar

    • Christian Fenzl
      Lebende Foren Legende
      • 31.08.2015
      • 11234

      #3
      You may use this example to detect the change of an analoque value: https://www.loxwiki.eu/pages/viewpag...pageId=9339459
      Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

      Kommentar

      • J V
        LoxBus Spammer
        • 28.08.2015
        • 367

        #4
        Thanks!
        That functionality is very nice (but completely not explained in the description of the function block). It should make things a bit easier.
        (sorry, I should have searched through the wiki better)
        Zuletzt geändert von J V; 17.04.2019, 13:26.

        Kommentar

        • J V
          LoxBus Spammer
          • 28.08.2015
          • 367

          #5
          Somehow the delay does not work; it keeps changing the value as if the delay was not set...

          I output the AQ of a status block to two memoryflags, both set to analogue, one has a delay 0, the other a delay 1. On a change of the status, both contain the new value of the status...

          Kommentar

          • Christian Fenzl
            Lebende Foren Legende
            • 31.08.2015
            • 11234

            #6
            A Memory flag itself always has a delay of 1, so if using two memory flags, you need the delay 1 and 2.

            btw, you won’t see this, as 1 means 1 PLC cycle, and the PLC is running with around 100 Hz.
            Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

            Kommentar

            • J V
              LoxBus Spammer
              • 28.08.2015
              • 367

              #7
              Oh... I misinterpreted how it would work... I thought it kept the previous value (a bit like an analog memory). Thanks for the clarification!

              Kommentar

              Lädt...