Autor Thema: Counter-camparison in Dispatcher?  (Gelesen 3587 mal)

Offline Per Olsen

  • Senior-Mitglied
  • Beiträge: 572
  • Ort: Bergen, Norway Ort bei GoogleMaps suchen no
Counter-camparison in Dispatcher?
« am: 27. März 2022, 08:49:02 »
Hello.

Is there a way (in Dispatcher) to compare 2 counters, and if the difference between them is a certain value, do the action? I cannot figure it out :) 

I use counters a lot, and love them :)  but I haven't found how to do just this :)  Is it possible?

Best regards,
Per
  • Win-Digipet-Version:
    WinDigiPet 2021
  • Anlagenkonfiguration:
    Tams Master Control.  Maerklin C-tracks. 6xBolls boosters.   2xLittfinski HSI-88 USB.  Bolls RMDs.   Viessmann and Bolls switch-decoders.
  • Rechnerkonfiguration:
    Windows 11 2,7GHz CPU, 16Gb RAM.

Offline Bernd Senger

  • Betatester
  • Senior-Mitglied
  • *
  • Beiträge: 2629
  • Ort: Königs Wusterhausen Ort bei GoogleMaps suchen de
Re: Counter-camparison in Dispatcher?
« Antwort #1 am: 27. März 2022, 11:44:06 »
Hi Per,

sure, you can do that. Within the dispatcher you'll find the condition "counter comparism" (expertmode is mandatory). Here you are able to set the conditions between two counters (e.g. not-equal). The corresponding action in your case could be "counter calculation".
Viele Grüße vom Rand Berlins
Bernd Senger
+++

----------------------------------------
Sonstiges
biete gerne Hilfe an, Sprachen: Deutsch, Englisch
  • Win-Digipet-Version:
    WDP 2021.x Beta
  • Anlagenkonfiguration:
    N-Anlage Neubau, ECoS II, TAMS mc2, YaMoRC YD7001, MDec.LDT, digikeijs LocoNet Rückm. (190 RMK)
  • Rechnerkonfiguration:
    AMD A10-7850K, 8 GB RAM, 34" UWQHD 3440x1440 Windows 10 64; Samsung Galaxy S21+

Offline Per Olsen

  • Senior-Mitglied
  • Beiträge: 572
  • Ort: Bergen, Norway Ort bei GoogleMaps suchen no
Re: Counter-camparison in Dispatcher?
« Antwort #2 am: 27. März 2022, 11:51:57 »
Hello!

Thank you.  I already know this.  This works if the 2 counters are equal, or if one is bigger (smaller) than the other.  But I want this to be true ONLY if the difference between the two, are for example 4.  Can I do that?

Regards,
Per.
  • Win-Digipet-Version:
    WinDigiPet 2021
  • Anlagenkonfiguration:
    Tams Master Control.  Maerklin C-tracks. 6xBolls boosters.   2xLittfinski HSI-88 USB.  Bolls RMDs.   Viessmann and Bolls switch-decoders.
  • Rechnerkonfiguration:
    Windows 11 2,7GHz CPU, 16Gb RAM.

Offline Stefan Lersch

  • Moderator
  • Senior-Mitglied
  • *
  • Beiträge: 6432
  • Ort: Brühl (bei Köln) Ort bei GoogleMaps suchen de
    • Infos zum Down-Syndrom alias Trisomie 21
Re: Counter-camparison in Dispatcher?
« Antwort #3 am: 27. März 2022, 15:10:14 »
Hello Per,

I don't have WDP open right now but I would use a third counter. This counter is always the second counter minus 4. Now you can compare the first and the third counter.
Viele Grüße,
Stefan
  • Win-Digipet-Version:
    WDP 2021.x Beta
  • Anlagenkonfiguration:
    N-Anlage im Bau, Minitrix &amp Co., Tams MC 2.2.3, DCC
  • Rechnerkonfiguration:
    Quad Core 8 GB mit Win 10, 32"quot Bildschirm

Offline Per Olsen

  • Senior-Mitglied
  • Beiträge: 572
  • Ort: Bergen, Norway Ort bei GoogleMaps suchen no
Re: Counter-camparison in Dispatcher?
« Antwort #4 am: 27. März 2022, 16:07:12 »
Hello, Stefan!

Yes, I was thinking something like that myself.  But I was hoping there was an easier way :)

Regards,
Per.
  • Win-Digipet-Version:
    WinDigiPet 2021
  • Anlagenkonfiguration:
    Tams Master Control.  Maerklin C-tracks. 6xBolls boosters.   2xLittfinski HSI-88 USB.  Bolls RMDs.   Viessmann and Bolls switch-decoders.
  • Rechnerkonfiguration:
    Windows 11 2,7GHz CPU, 16Gb RAM.

Offline Per Olsen

  • Senior-Mitglied
  • Beiträge: 572
  • Ort: Bergen, Norway Ort bei GoogleMaps suchen no
Re: Counter-camparison in Dispatcher?
« Antwort #5 am: 28. März 2022, 23:03:13 »

Stefan, can you show me an example?  I am actually struggling with this..

Regards,
Per.
  • Win-Digipet-Version:
    WinDigiPet 2021
  • Anlagenkonfiguration:
    Tams Master Control.  Maerklin C-tracks. 6xBolls boosters.   2xLittfinski HSI-88 USB.  Bolls RMDs.   Viessmann and Bolls switch-decoders.
  • Rechnerkonfiguration:
    Windows 11 2,7GHz CPU, 16Gb RAM.

Offline Per Olsen

  • Senior-Mitglied
  • Beiträge: 572
  • Ort: Bergen, Norway Ort bei GoogleMaps suchen no
Re: Counter-camparison in Dispatcher?
« Antwort #6 am: 29. März 2022, 08:09:29 »
Hi again.

My problem is:  How do I make "Counter 2" always 4 (or any other value) higher (or lower) "Counter 1" ?  To be true always when "Counter 1" changes value.

Regards,
Per.
  • Win-Digipet-Version:
    WinDigiPet 2021
  • Anlagenkonfiguration:
    Tams Master Control.  Maerklin C-tracks. 6xBolls boosters.   2xLittfinski HSI-88 USB.  Bolls RMDs.   Viessmann and Bolls switch-decoders.
  • Rechnerkonfiguration:
    Windows 11 2,7GHz CPU, 16Gb RAM.

Offline Stefan Lersch

  • Moderator
  • Senior-Mitglied
  • *
  • Beiträge: 6432
  • Ort: Brühl (bei Köln) Ort bei GoogleMaps suchen de
    • Infos zum Down-Syndrom alias Trisomie 21
Re: Counter-camparison in Dispatcher?
« Antwort #7 am: 29. März 2022, 22:36:48 »
Hi Per,


I'm a little short of time at the moment. But I will think about your problem.
Viele Grüße,
Stefan
  • Win-Digipet-Version:
    WDP 2021.x Beta
  • Anlagenkonfiguration:
    N-Anlage im Bau, Minitrix &amp Co., Tams MC 2.2.3, DCC
  • Rechnerkonfiguration:
    Quad Core 8 GB mit Win 10, 32"quot Bildschirm

Offline Stefan Lersch

  • Moderator
  • Senior-Mitglied
  • *
  • Beiträge: 6432
  • Ort: Brühl (bei Köln) Ort bei GoogleMaps suchen de
    • Infos zum Down-Syndrom alias Trisomie 21
Re: Counter-camparison in Dispatcher?
« Antwort #8 am: 30. März 2022, 07:30:35 »
Hi Per,

I found the solution yesterday when lying in my bed. :) The point is that a dispatcher fires only if a condition becomes true. It does not fire if it is already true. Counter 1 is your starting point and counter 2 should be counter 1 plus 4. So you need a condition that changes when you change counter 1.

You need 4 counters. There are the above mentioned counters 1 and 2 and then there are the helpers 1 and 2. Helper 2 is always 4. Helper 1 stores the last value of counter 1.

So at the beginning counter 1 and helper 1 have the same value. In the dispatcher you compare the values of counter 1 and helper 1. If you change the value of counter 1 the dispatcher will fire. It will set counter 2 to the value of counter 1. Then it will add the value of helper 2 (here: 4) on top. Finally helper 1 is set to the value of counter 1.

So this will add 4 as you wished and it will always fire whenever you change the value of counter 1. See attechments.

Zu diesem Beitrag gehören 2 Anhäng(e). Um diese zu sehen oder zum Download müssen Sie sich einloggen.
Viele Grüße,
Stefan
  • Win-Digipet-Version:
    WDP 2021.x Beta
  • Anlagenkonfiguration:
    N-Anlage im Bau, Minitrix &amp Co., Tams MC 2.2.3, DCC
  • Rechnerkonfiguration:
    Quad Core 8 GB mit Win 10, 32"quot Bildschirm

Offline Per Olsen

  • Senior-Mitglied
  • Beiträge: 572
  • Ort: Bergen, Norway Ort bei GoogleMaps suchen no
Re: Counter-camparison in Dispatcher?
« Antwort #9 am: 30. März 2022, 10:02:45 »
Hello.

Yes, I know it fires only when there is a change. 
I tested your suggestion, and it works fine!  So now I will implement it to my layout.  It should work nicely :)

Thanks again, for super help, Stefan!

Best regards,
Per.
  • Win-Digipet-Version:
    WinDigiPet 2021
  • Anlagenkonfiguration:
    Tams Master Control.  Maerklin C-tracks. 6xBolls boosters.   2xLittfinski HSI-88 USB.  Bolls RMDs.   Viessmann and Bolls switch-decoders.
  • Rechnerkonfiguration:
    Windows 11 2,7GHz CPU, 16Gb RAM.