Ist der Typ den richtig für diese SV?
Wenn ja, warum steht da dann nichts drin? Das Skript funktioniert und das Display wird auch aktualisiert?
Hier noch einmal mein Skript
Code: Alles auswählen
string temp = dom.GetObject('BidCos-RF.OEQ0072229:1.TEMPERATURE').Value().ToString(1) # " °C";
string dc = dom.GetObject('DutyCycle').Value().ToString(0) # " %";
string hdruck = dom.GetObject('BidCos-RF.JPPRESS001:1.UNI_PRESSURE').Value().ToString(2) # " bar";
string line1 = "/1 '@p00Außen@p65" # temp # "'";
string line2 = "/2 '@p00DutyCycle@p65" # dc # "'";
string line3 = "/3 '@p00Heizungsdruck@p65" # hdruck # "'";
string line4 = "/4 ''";
string line5 = "/5 ''";
string line6 = "/6 ''";
string line7 = "/7 ''";
string line8 = "/8 ''";
string line9 = "/9 ''";
string line10 = "/10 ''";
! Um DutyRate zu sparen nur die Zeilen übertragen die sich geändert haben
string lastLines = dom.GetObject("EPAPER.Lines000").Value();
string index;
string linesDoNotUpdate = "";
foreach (index, lastLines) {
if (index.Substr(0, 2) == "/1") {
if (index == line1) {
linesDoNotUpdate = linesDoNotUpdate # "L01";
}
} elseif (index.Substr(0, 2) == "/2") {
if (index == line2) {
linesDoNotUpdate = linesDoNotUpdate # "L02";
}
} elseif (index.Substr(0, 2) == "/3") {
if (index == line3) {
linesDoNotUpdate = linesDoNotUpdate # "L03";
}
} elseif (index.Substr(0, 2) == "/4") {
if (index == line4) {
linesDoNotUpdate = linesDoNotUpdate # "L04";
}
} elseif (index.Substr(0, 2) == "/5") {
if (index == line5) {
linesDoNotUpdate = linesDoNotUpdate # "L05";
}
} elseif (index.Substr(0, 2) == "/6") {
if (index == line6) {
linesDoNotUpdate = linesDoNotUpdate # "L06";
}
} elseif (index.Substr(0, 2) == "/7") {
if (index == line7) {
linesDoNotUpdate = linesDoNotUpdate # "L07";
}
} elseif (index.Substr(0, 2) == "/8") {
if (index == line8) {
linesDoNotUpdate = linesDoNotUpdate # "L08";
}
} elseif (index.Substr(0, 2) == "/9") {
if (index == line9) {
linesDoNotUpdate = linesDoNotUpdate # "L09";
}
} elseif (index.Substr(0, 3) == "/10") {
if (index == line10) {
linesDoNotUpdate = linesDoNotUpdate # "L10";
}
}
}
! Wegen einem Limit bei der RF Übertragung in der CCU kann man nicht alle 10 in einem Funktelegramm übertragen.
! Deswegen wird hier die Übertragung immer in 2 Funktelegramme aufgeteilt.
string displayCmdA = "JPDISEP000";
string displayCmdB = "JPDISEP000";
integer iChangedLinesA = 0;
integer iChangedLinesB = 0;
if (linesDoNotUpdate.Find("L01") < 0) {
displayCmdA = displayCmdA # " " # line1; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L02") < 0) {
displayCmdA = displayCmdA # " " # line2; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L03") < 0) {
displayCmdA = displayCmdA # " " # line3; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L04") < 0) {
displayCmdA = displayCmdA # " " # line4; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L05") < 0) {
displayCmdA = displayCmdA # " " # line5; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L06") < 0) {
displayCmdB = displayCmdB # " " # line6; iChangedLinesB = iChangedLinesB + 1;
}
if (linesDoNotUpdate.Find("L07") < 0) {
displayCmdB = displayCmdB # " " # line7; iChangedLinesB = iChangedLinesB + 1;
}
if (linesDoNotUpdate.Find("L08") < 0) {
displayCmdB = displayCmdB # " " # line8; iChangedLinesB = iChangedLinesB + 1;
}
if (linesDoNotUpdate.Find("L09") < 0) {
displayCmdB = displayCmdB # " " # line9; iChangedLinesB = iChangedLinesB + 1;
}
if (linesDoNotUpdate.Find("L10") < 0) {
displayCmdB = displayCmdB # " " # line10; iChangedLinesB = iChangedLinesB + 1;
}
if (iChangedLinesA > 0) {
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("tclsh /usr/local/addons/epaper42.tcl " # displayCmdA);
}
if (iChangedLinesB > 0) {
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("tclsh /usr/local/addons/epaper42.tcl " # displayCmdB);
}
! Für nächsten Vergleich speichern, Tab Seperator für for_each loop benötigt
string currentLines = line1 # "\t" line2 # "\t" # line3 # "\t" # line4 # "\t" # line5 # "\t" # line6 # "\t" # line7 # "\t" # line8 # "\t" # line9 # "\t" # line10;
dom.GetObject("EPAPER.Lines000").State(currentLines);
Grüße
Manfred