Du musst auch nicht immer alle Zeilen setzen.
Wenn du nur Zeile 4 ändern möchtest, reicht es, auch nur Zeile 4 neu zu übertragen.
Jedoch muss das anzuzeigende Icon immer mit übertragen werden (selbst wenn es sich nicht ändert) - Text und Icon gehören zusammen..
Um DutyCycle zu sparen, empfehle ich auch, nach Möglichkeit mit Fixtexten zu arbeiten.
Hier mal das Skript, das ich verwende, um den Bildschirm initial zu füllen (ohne Datum).
Nur als Anregung, ohne Erklärungen:
Code: Alles auswählen
var tempvalNum = dom.GetObject("BidCos-RF.JPWEA00001:1.TEMPERATURE").Value();
var tempvalRound = tempvalNum.ToString(0);
var lastTempvalRound = dom.GetObject("Aussentemperatur_Gerundet").Value();
dom.GetObject("Aussentemperatur_Gerundet").State(tempvalRound);
var tempAbsolut = tempvalNum.Abs();
string msgBuffer = tempAbsolut.ToString(0);
string substitutions = "A,0x41\tB,0x42\tC,0x43\tD,0x44\tE,0x45\tF,0x46\tG,0x47\tH,0x48\tI,0x49\tJ,0x4A\tK,0x4B\tL,0x4C\tM,0x4D\tN,0x4E\tO,0x4F\tP,0x50\tQ,0x51\tR,0x52\tS,0x53\tT,0x54\tU,0x55\tV,0x56\tW,0x57\tX,0x58\tY,0x59\tZ,0x5A";
substitutions = substitutions # "\ta,0x61\tb,0x62\tc,0x63\td,0x64\te,0x65\tf,0x66\tg,0x67\th,0x68\ti,0x69\tj,0x6A\tk,0x6B\tl,0x6C\tm,0x6D\tn,0x6E\to,0x6F\tp,0x70\tq,0x71\tr,0x72\ts,0x73\tt,0x74\tu,0x75\tv,0x76\tw,0x77\tx,0x78\ty,0x79\tz,0x7A";
substitutions = substitutions # "\t0,0x30\t1,0x31\t2,0x32\t3,0x33\t4,0x34\t5,0x35\t6,0x36\t7,0x37\t8,0x38\t9,0x39\t ,0x20\t!,0x21\t\",0x22\t%,0x25\t&,0x26\t=,0x27\t(,0x28\t),0x29\t*,0x2A\t+,0x2B\t,,0x2C\t-,0x2D\t.,0x2E\t/,0x2F";
substitutions = substitutions # "\tÄ,0x5B\tÖ,0x23\tÜ,0x24\tä,0x7B\tö,0x7C\tü,0x7D\tß,0x5F\t:,0x3A\t;,0x3B\t@,0x40\t>,0x3E";
string bufferLine;
string substEntry;
integer i;
string char;
string line;
string cmdRepl = "";
foreach(bufferLine, msgBuffer) {
line = bufferLine;
integer linelength = line.Length();
if ((linelength > 0)) {
if ((linelength == 4) && (line.Substr(0,2) == "0x")) {
cmdRepl = cmdRepl # "," # line;
i = 12;
}
else {
i = 0;
}
if (linelength > 12) {
linelength = 12;
}
while (i < linelength) {
char = line.Substr(i, 1);
boolean b = true;
foreach(substEntry, substitutions){
if (b == true){
if (char == substEntry.Substr(0,1)){
cmdRepl = cmdRepl # substEntry.Substr(1,5);
b = false;
}
}
}
i = i + 1;
}
}
}
var temperature = cmdRepl;
WriteLine(cmdRepl);
var freeze = "";
if (tempvalNum <= 0) {
temperature = ",0x2d"#temperature;
freeze = ",0x13,0x8f";
}
var klingelAn = ",0x8a";
if (dom.GetObject(ID_SYSTEM_VARIABLES).Get("Türklingel").Value() == true) {
klingelAn = ",0x89";
}
var command = "0x02,0x12,0x80,0x13,0x89,0x0A,0x0A,0x0A,0x0A,0x12,0x81,0x0A,0x12"#temperature#",0x20,0xb0,0x43"#freeze#",0x0A,0x0A,0x0A,0x0A,0x12"#klingelAn#",0x13,0x92,0x0A,0x03";
WriteLine(command);
dom.GetObject("BidCos-RF.JPDISEP001:11.SUBMIT").State(command);
Code: Alles auswählen
integer d = system.Date("%w").ToInteger() + 82;
string dayCommand = "0x"#d.ToString();
string datum = system.Date("%d.%m.%Y");
string substitutions = "A,0x41\tB,0x42\tC,0x43\tD,0x44\tE,0x45\tF,0x46\tG,0x47\tH,0x48\tI,0x49\tJ,0x4A\tK,0x4B\tL,0x4C\tM,0x4D\tN,0x4E\tO,0x4F\tP,0x50\tQ,0x51\tR,0x52\tS,0x53\tT,0x54\tU,0x55\tV,0x56\tW,0x57\tX,0x58\tY,0x59\tZ,0x5A";
substitutions = substitutions # "\ta,0x61\tb,0x62\tc,0x63\td,0x64\te,0x65\tf,0x66\tg,0x67\th,0x68\ti,0x69\tj,0x6A\tk,0x6B\tl,0x6C\tm,0x6D\tn,0x6E\to,0x6F\tp,0x70\tq,0x71\tr,0x72\ts,0x73\tt,0x74\tu,0x75\tv,0x76\tw,0x77\tx,0x78\ty,0x79\tz,0x7A";
substitutions = substitutions # "\t0,0x30\t1,0x31\t2,0x32\t3,0x33\t4,0x34\t5,0x35\t6,0x36\t7,0x37\t8,0x38\t9,0x39\t ,0x20\t!,0x21\t\",0x22\t%,0x25\t&,0x26\t=,0x27\t(,0x28\t),0x29\t*,0x2A\t+,0x2B\t,,0x2C\t-,0x2D\t.,0x2E\t/,0x2F";
substitutions = substitutions # "\tÄ,0x5B\tÖ,0x23\tÜ,0x24\tä,0x7B\tö,0x7C\tü,0x7D\tß,0x5F\t:,0x3A\t;,0x3B\t@,0x40\t>,0x3E";
string bufferLine;
string substEntry;
integer i;
string char;
string line;
string command = ",0x0A";
foreach(bufferLine, datum) {
line = bufferLine;
integer linelength = line.Length();
if ((linelength > 0)) {
command = command # ",0x12";
if ((linelength == 4) && (line.Substr(0,2) == "0x")) {
command = command # "," # line;
i = 12;
}
else {
i = 0;
}
if (linelength > 12) {
linelength = 12;
}
while (i < linelength) {
char = line.Substr(i, 1);
boolean b = true;
foreach(substEntry, substitutions){
if (b == true){
if (char == substEntry.Substr(0,1)){
command = command # substEntry.Substr(1,5);
b = false;
}
}
}
i = i + 1;
}
}
command = command # ",0x0A";
}
var cmd = "0x02,0x0A,0x0A,0x12,"#dayCommand#command#",0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x03";
WriteLine(cmd);
dom.GetObject("BidCos-RF.JPDISEP001:11.SUBMIT").State(cmd);