Gegeben ein Makro, das eine Reihe von 8 GAs verarbeiten soll, die Basis der Untergruppe ist immer "0".
[highlight=epc]
:begin RolloFensterGriffMainDefinitions(Name, pGAbase)
:info $Bereitstellen der Variablen für die verschiedenen Makros zur Interaktion$\\
$Name zur Eindeutigkeit$\\
$Basisgruppenadresse des Rollladens$
//Rollladenglobale Konstanten
Name_DoLearnNow = AUS //Löst den Lernvorgang aus - Auch verwendet in Makro "TasteGotoAndLearnpos"
Name_DoGotoLearntPos = AUS //Löst den Goto-Vorgang zur gelernten Position aus - Auch verwendet in Makro "TasteGotoAndLearnpos"
Name_GAbasis = getaddress(pGAbase)
Name_GAstop = getaddress(pGAbase) + 1u16
Name_GAStatusOben = getaddress(pGAbase) + 2u16
Name_GAStatusUnten = getaddress(pGAbase) + 3u16
Name_GAStatusPosition = getaddress(pGAbase) + 4u16
Name_GAGoToPos = getaddress(pGAbase) + 5u16
Name_GATasteDoppelklick = getaddress(pGAbase) + 6u16
Name_GALEDquittung = getaddress(pGAbase) + 7u16
.......
[/highlight]
Damit will ich mir ersparen, bei 14 Rollläden insgesamt 112 GAs als Parameter richtig einkopieren zu müssen und eine typische Fehlerquelle (ich...) vermeiden.
In den darauf aufbauenden Makros (es werden nicht immer alle benutzt) sollen die GAs dann wie im Manual mit write(adress(...),Wert) beschrieben als address(Name_GA...) verwendet werden:
[highlight=epc]
begin Rollo(Name, btnShiftAufABStop, btnLearnPos, pgID, FlashAdrGoto)
:info $Rollladenbedienung: RAUF, RUNTER, STOP, PROZENTPOSITION anfahren$ \\
$Name (wegen Eindeutigkeit)$\\
$Web: pShifter Runter / Rauf / Goto / Stop für $\\
$Web: pButton Position lernen$\\
$Web: Page ID$\\
$Flash: Adresse des gelernten Prozentwerts (u08)$\\ //Wertebereich 0..255 !
...
/* ----------------------- Abarbeiten der Events ------------------ */
if event(address(Name_GAbasis)) or event(address(Name_GAGoToPos)) then {
Name_isMoving = EIN;
if (address(Name_GAbasis) == RAUF) or (Name_PosAktuell > Name_GoToPos) then {
pdisplay(btnLearnPos,$Fährt auf $ + convert(Uhrzeit,$$),UP,ACTIVE,GREEN,pgID);
} else {
pdisplay(btnLearnPos,$Fährt zu $ + convert(Uhrzeit,$$),DOWN,ACTIVE,GREEN,pgID);
} endif
} endif
// STOP-Event
if (event(address(Name_GAstop)) and (address(Name_GAstop)) == EIN) then {
pdisplay(btnShiftAufABStop,Uhrzeit,STOP,BRIGHTRED, GREEN,pgID);
Name_StopPressed = EIN;
Name_isMoving = AUS;
} endif
if (delay(Name_StopPressed==EIN, 5000u64)) then {
pdisplay(btnShiftAufABStop,Uhrzeit,STOP,INACTIVE,G REEN,pgID);
Name_StopPressed = AUS;
} endif
// Statusauswertungen
if event(address(Name_GAStatusPosition)) or (event(address(Name_GAStatusOben)) and address(Name_GAStatusOben)) or (event(address(Name_GAStatusUnten)) and address(Name_GAStatusUnten)) then {
Name_isMoving = AUS;
Name_PosAktuell = address(Name_GAStatusPosition);
Name_GoToPos = Name_PosAktuell;
if (address(Name_GAStatusPosition) == 0% or address(Name_GAStatusOben)) then {
pdisplay(btnLearnPos,convert( 0f16,$$) + $ %$,ROLLER,STATE7,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) == 100% or address(Name_GAStatusUnten)) then {
pdisplay(btnLearnPos,convert(100f16,$$) + $ %$,ROLLER,ACTIVE,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) == C^Name^Lamel) and !address(Name_GAStatusOben) and !address(Name_GAStatusUnten) then {
pdisplay(btnLearnPos,convert(address(Name_GAStatus Position),$$) + $ %$,ROLLER,STATE4,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) < 100%) and (address(Name_GAStatusPosition) > C^Name^Lamel) and !address(Name_GAStatusOben) and !address(Name_GAStatusUnten) then {
pdisplay(btnLearnPos,convert(convert(address(Name_ GAStatusPosition),0f16) * 100f16 / 255f16,$$) + $ %$,ROLLER,DISPLAY,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) > 0%) and (address(Name_GAStatusPosition) < C^Name^Lamel) and !address(Name_GAStatusOben) and !address(Name_GAStatusUnten) then {
pdisplay(btnLearnPos,convert(convert(address(Name_ GAStatusPosition),0f16) * 100f16 / 255f16,$$) + $ %$,ROLLER,STATE5,GREEN,pgID);
} endif;
if (Name_Ausloeser == 1) then {
Name_ManuellPos = Name_PosAktuell;
Name_ManuellPosTime = utctime();
} endif;
if (Name_Ausloeser == 1) then {
Name_ManuellPos = Name_PosAktuell;
Name_ManuellPosTime = utctime();
} endif;
pdisplay(btnShiftAufABStop,Uhrzeit,STOP,INACTIVE,G REEN,pgID);
} endif
...
[/highlight]
Beim Kompilieren (Name=RollDGBuero) motzt EibStudio:
!! Anwendungsfehler !!
Gruppenadresse wurde doppelt definiert:RollDGBuero_GAGoToPos
EC:103
Kommentiere ich oben die Zeilen 10 bis 17 (if event(address(Name_GAbasis...) aus, bemängelt EibStudio:
!! Anwendungsfehler !!
Gruppenadresse wurde doppelt definiert:RollDGBuero_GAStatusPosition
EC:103
Anscheinend verschluckt es sich jetzt an Zeile 29.
Gibt es irgendwelche bekannten Probleme oder Einschränkungen bei der Verwendung von address() / getaddress() in Makros?
[highlight=epc]
:begin RolloFensterGriffMainDefinitions(Name, pGAbase)
:info $Bereitstellen der Variablen für die verschiedenen Makros zur Interaktion$\\
$Name zur Eindeutigkeit$\\
$Basisgruppenadresse des Rollladens$
//Rollladenglobale Konstanten
Name_DoLearnNow = AUS //Löst den Lernvorgang aus - Auch verwendet in Makro "TasteGotoAndLearnpos"
Name_DoGotoLearntPos = AUS //Löst den Goto-Vorgang zur gelernten Position aus - Auch verwendet in Makro "TasteGotoAndLearnpos"
Name_GAbasis = getaddress(pGAbase)
Name_GAstop = getaddress(pGAbase) + 1u16
Name_GAStatusOben = getaddress(pGAbase) + 2u16
Name_GAStatusUnten = getaddress(pGAbase) + 3u16
Name_GAStatusPosition = getaddress(pGAbase) + 4u16
Name_GAGoToPos = getaddress(pGAbase) + 5u16
Name_GATasteDoppelklick = getaddress(pGAbase) + 6u16
Name_GALEDquittung = getaddress(pGAbase) + 7u16
.......
[/highlight]
Damit will ich mir ersparen, bei 14 Rollläden insgesamt 112 GAs als Parameter richtig einkopieren zu müssen und eine typische Fehlerquelle (ich...) vermeiden.
In den darauf aufbauenden Makros (es werden nicht immer alle benutzt) sollen die GAs dann wie im Manual mit write(adress(...),Wert) beschrieben als address(Name_GA...) verwendet werden:
[highlight=epc]
begin Rollo(Name, btnShiftAufABStop, btnLearnPos, pgID, FlashAdrGoto)
:info $Rollladenbedienung: RAUF, RUNTER, STOP, PROZENTPOSITION anfahren$ \\
$Name (wegen Eindeutigkeit)$\\
$Web: pShifter Runter / Rauf / Goto / Stop für $\\
$Web: pButton Position lernen$\\
$Web: Page ID$\\
$Flash: Adresse des gelernten Prozentwerts (u08)$\\ //Wertebereich 0..255 !
...
/* ----------------------- Abarbeiten der Events ------------------ */
if event(address(Name_GAbasis)) or event(address(Name_GAGoToPos)) then {
Name_isMoving = EIN;
if (address(Name_GAbasis) == RAUF) or (Name_PosAktuell > Name_GoToPos) then {
pdisplay(btnLearnPos,$Fährt auf $ + convert(Uhrzeit,$$),UP,ACTIVE,GREEN,pgID);
} else {
pdisplay(btnLearnPos,$Fährt zu $ + convert(Uhrzeit,$$),DOWN,ACTIVE,GREEN,pgID);
} endif
} endif
// STOP-Event
if (event(address(Name_GAstop)) and (address(Name_GAstop)) == EIN) then {
pdisplay(btnShiftAufABStop,Uhrzeit,STOP,BRIGHTRED, GREEN,pgID);
Name_StopPressed = EIN;
Name_isMoving = AUS;
} endif
if (delay(Name_StopPressed==EIN, 5000u64)) then {
pdisplay(btnShiftAufABStop,Uhrzeit,STOP,INACTIVE,G REEN,pgID);
Name_StopPressed = AUS;
} endif
// Statusauswertungen
if event(address(Name_GAStatusPosition)) or (event(address(Name_GAStatusOben)) and address(Name_GAStatusOben)) or (event(address(Name_GAStatusUnten)) and address(Name_GAStatusUnten)) then {
Name_isMoving = AUS;
Name_PosAktuell = address(Name_GAStatusPosition);
Name_GoToPos = Name_PosAktuell;
if (address(Name_GAStatusPosition) == 0% or address(Name_GAStatusOben)) then {
pdisplay(btnLearnPos,convert( 0f16,$$) + $ %$,ROLLER,STATE7,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) == 100% or address(Name_GAStatusUnten)) then {
pdisplay(btnLearnPos,convert(100f16,$$) + $ %$,ROLLER,ACTIVE,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) == C^Name^Lamel) and !address(Name_GAStatusOben) and !address(Name_GAStatusUnten) then {
pdisplay(btnLearnPos,convert(address(Name_GAStatus Position),$$) + $ %$,ROLLER,STATE4,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) < 100%) and (address(Name_GAStatusPosition) > C^Name^Lamel) and !address(Name_GAStatusOben) and !address(Name_GAStatusUnten) then {
pdisplay(btnLearnPos,convert(convert(address(Name_ GAStatusPosition),0f16) * 100f16 / 255f16,$$) + $ %$,ROLLER,DISPLAY,GREEN,pgID);
} endif;
if (address(Name_GAStatusPosition) > 0%) and (address(Name_GAStatusPosition) < C^Name^Lamel) and !address(Name_GAStatusOben) and !address(Name_GAStatusUnten) then {
pdisplay(btnLearnPos,convert(convert(address(Name_ GAStatusPosition),0f16) * 100f16 / 255f16,$$) + $ %$,ROLLER,STATE5,GREEN,pgID);
} endif;
if (Name_Ausloeser == 1) then {
Name_ManuellPos = Name_PosAktuell;
Name_ManuellPosTime = utctime();
} endif;
if (Name_Ausloeser == 1) then {
Name_ManuellPos = Name_PosAktuell;
Name_ManuellPosTime = utctime();
} endif;
pdisplay(btnShiftAufABStop,Uhrzeit,STOP,INACTIVE,G REEN,pgID);
} endif
...
[/highlight]
Beim Kompilieren (Name=RollDGBuero) motzt EibStudio:
!! Anwendungsfehler !!
Gruppenadresse wurde doppelt definiert:RollDGBuero_GAGoToPos
EC:103
Kommentiere ich oben die Zeilen 10 bis 17 (if event(address(Name_GAbasis...) aus, bemängelt EibStudio:
!! Anwendungsfehler !!
Gruppenadresse wurde doppelt definiert:RollDGBuero_GAStatusPosition
EC:103
Anscheinend verschluckt es sich jetzt an Zeile 29.
Gibt es irgendwelche bekannten Probleme oder Einschränkungen bei der Verwendung von address() / getaddress() in Makros?
Kommentar