Kleines Makro aus dem Supportbereich: Entprellen eines Schalt/Tasteingangs...
Code:
// Taste Entprellen // @date 03.08.2016 // @version 1 // @author Enertex Bayern GmbH :begin vmTasteEntprellen(bGATaste,bGAAusgang,uZeit) :info $Eine Taste/Kontakt Entprellen$\\ $GA des Kontakts/Taste (b01))$\\ $GA des Ausgangs (b01)$\\ $Zeit in ms als Zahl, z.B. 1400 für 1,4 Sekunden (u64)$ :shortinfo $Eine Taste/Kontakt Entprellen$ :var bAusgang@ bAusgang@=AUS if bGATaste==EIN and bAusgang@==AUS then { bAusgang@=EIN; write(bGAAusgang,EIN); } endif // Entprellung if after(bAusgang@==EIN, uZeit^u64) then { bAusgang@=AUS; } endif if bGATaste==AUS and bGAAusgang==AUS then { write(bGAAusgang,AUS); } endif :endif
Kommentar