Die darzustellende Zahl wird über die integer Variable iWert gesetzt. Sie muß entweder direkt im Code definiert werden, d.h. Kommentar in Zeile 3 entfernen oder vom aufrufenden Programm gesetzt werden.
Code: Alles auswählen
string Geraet = "HmIP-WRCD xxxxx:3"; ! Name von Kanal 3 des Displays
!integer iWert = 10;
integer iZ = 9; ! 0 ... 9
string sZ1 = " >@, =, @@@@, @@@ ,= ,>>>>, >>>,>>>>, >@@, >@@";
string sZ2 = " > @, >=, =, =,= = ,= ,= , >,= =,= =";
string sZ3 = "= =,> =, >@@>,@@@@,@@=@, @@@,=@@@, >, ===, @==";
string sZ4 = " @ >, =,= , =, = , =,= =, >,= =, =";
string sZ5 = " @>, =,@@@@ ,@@@>, = ,@@@>,@>>>, >, @@>, @>";
string sM1 = " ";
string sM2 = sM1;
string sM3 = "µµ ";
string sM4 = sM1;
string sM5 = sM1;
if (iWert < 10) {
if (iWert < 0) {
iZ = iWert * -1;
string ZEILE_1 = sM1 # sZ1.StrValueByIndex(",", iZ);
string ZEILE_2 = sM2 # sZ2.StrValueByIndex(",", iZ);
string ZEILE_3 = sM3 # sZ3.StrValueByIndex(",", iZ);
string ZEILE_4 = sM4 # sZ4.StrValueByIndex(",", iZ);
string ZEILE_5 = sM5 # sZ5.StrValueByIndex(",", iZ);
} else {
iZ = iWert;
string ZEILE_1 = sZ1.StrValueByIndex(",", iZ);
string ZEILE_2 = sZ2.StrValueByIndex(",", iZ);
string ZEILE_3 = sZ3.StrValueByIndex(",", iZ);
string ZEILE_4 = sZ4.StrValueByIndex(",", iZ);
string ZEILE_5 = sZ5.StrValueByIndex(",", iZ);
}
} else {
iZ = iWert / 10;
WriteLine("iWert=" # iWert # " Zehner=" # iZ);
string ZEILE_1 = sZ1.StrValueByIndex(",", iZ);
string ZEILE_2 = sZ2.StrValueByIndex(",", iZ);
string ZEILE_3 = sZ3.StrValueByIndex(",", iZ);
string ZEILE_4 = sZ4.StrValueByIndex(",", iZ);
string ZEILE_5 = sZ5.StrValueByIndex(",", iZ);
iZ = iWert % 10;
WriteLine(" Einer=" # iZ);
ZEILE_1 = ZEILE_1 # " " # sZ1.StrValueByIndex(",", iZ);
ZEILE_2 = ZEILE_2 # " " # sZ2.StrValueByIndex(",", iZ);
ZEILE_3 = ZEILE_3 # " " # sZ3.StrValueByIndex(",", iZ);
ZEILE_4 = ZEILE_4 # " " # sZ4.StrValueByIndex(",", iZ);
ZEILE_5 = ZEILE_5 # " " # sZ5.StrValueByIndex(",", iZ);
}
! String in einem zusammenbauen, nur einen Befehl abzusetzen kostet weniger Duty Cycle
string ZeilenRefresh = "{DDBC=WHITE,DDTC=BLACK,DDI=0,DDA=LEFT,DDS="#ZEILE_1#",DDID=1,DDC=true},{DDBC=WHITE,DDTC=BLACK,DDI=0,DDA=LEFT,DDS="#ZEILE_2#",DDID=2,DDC=true},{DDBC=WHITE,DDTC=BLACK,DDI=0,DDA=LEFT,DDS="#ZEILE_3#",DDID=3,DDC=true},{DDBC=WHITE,DDTC=BLACK,DDI=0,DDA=LEFT,DDS="#ZEILE_4#",DDID=4,DDC=true},{DDBC=WHITE,DDTC=BLACK,DDI=0,DDA=LEFT,DDS="#ZEILE_5#",DDID=5,DDC=true}";
! neuen Inhalt auf dem Display setzen
channels.Get(Geraet).DPByHssDP("COMBINED_PARAMETER").State(ZeilenRefresh);
WriteLine(ZeilenRefresh);