Benutzer-Werkzeuge

Webseiten-Werkzeuge


advanced_macro

Dies ist eine alte Version des Dokuments!


Mehr zu Makro und Accessory

In diesem Kapitel werden tiefergehende Erläuterungen zu Makro und Accessory beschrieben.

Accessory notify

The port type 'Accessory notify' must only be used if the accessory should send the result before the accessory has finished (really finished). The accessory is normally finished when the assigned macro has finished. But think of the case where the macro closes the gates of a railway crossing. The signal lights start blinking, the bars are moved down with the servo, they reach their end position and the signal lights should blink for some time. The following image shows the required macros.

If you assign the aspect of the accessory and press the test button, the accessory is in state 'pending' (the clock icon in the Wizard) until the input with name 'Servo end right reached' (or left reached) gets the value '1' ( I tested with a shortcut on GPIO 0 which is port 25), and then reaches the state 'finished' (the green mark icon in the Wizard). If this input port does not get the value '1' then the accessory will not be signalled as finished and stays in 'pending' state.

This description was the „normal execution“ of an accessory.

If you want to signal that the accessory has finished earlier, for example because you added a sound that is played from start and during the bars going down, and 20s after the bars (the servo) reached the end position the sound should be turned off, then you could use the 'accessory notify'-actions.

You can use 'Accessory Notify' here because the train does not care if the sound has stopped playing, they only care about the fact, that the bars are down and the 'Switch servo right/left reached)' input is 'happy'. In this case you can use an 'accessory notify' step after the end position was reached (confirmed by the input), before the sound has finished (and therefore the macro has finished).

Accessory notify - ' Okay, if value = 0 / 1'

In the macro below the accessory will always be finished with an error because in step 4 the input 'Servo end left reached' waits until it becomes '1' and some ms later the check in step 6 for the same input with a value = '0' is performed. So the Action should be interpreted as 'Return result Okay, if value = '0' and error otherwise'.

Change I/O behaviour of input port

You can switch between INPUT_PULLUP and INPUT_PULLDOWN only in the CV Definitions-Tab.

  1. Load the CV values from the node (see the steps here)
  2. Change the Bit 1 of GPIO port you want to change (press Memorize before store the changes back on the node)
  3. Restart of the node is required (use context menü of the node)
  4. After restart the I/O Behaviour of the port has changed.

After Restart:

advanced_macro.1522149694.txt.gz · Zuletzt geändert: 2018/03/27 13:21 von akuhtz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki