-> Hier kostenlos registrieren
Hallo ,
ich habe Probleme per button ein txt file von der Festplatte meines Visurechners ins die SPS zu schreiben . Mein Ansatz :
***************************************************************************************************************
export async function Schaltfläche_10_OnTapped(item, x, y, modifiers, trigger) {
HMIRuntime.Tags.SysFct.SetTagValue("TimeProgNo", 1); // hier beschreibe ich meinen Zeiger auf 1 / Array in der SPS
// Please note, the format of a file path is device and operating system specific.
// You need to adapt the given path to your environment.
// Example for a Unified Comfort device (Linux OS): /home/user1/data.dat
// Example for a Unified PC-based device (MS Windows OS): C:\Users\Public\data.dat
HMIRuntime.FileSystem.ReadFile("C:\bm\miniring\fill\a\suck.txt", "utf8").then( // damit versuche ich einen tag Text den ich als WSTRING
function(text) { // angelegt habe zu beschreiben
screen.items("myText1").text =text;
HMIRuntime.Trace("Text=" + text);
});
}
das Script habe ich so in einem Beispiel für Textfile einlesen gefunden
Wenn jemend das so schon mal umgesetzt hat wäre ich für einen Tip dankbar
Grüsse
ich habe Probleme per button ein txt file von der Festplatte meines Visurechners ins die SPS zu schreiben . Mein Ansatz :
***************************************************************************************************************
export async function Schaltfläche_10_OnTapped(item, x, y, modifiers, trigger) {
HMIRuntime.Tags.SysFct.SetTagValue("TimeProgNo", 1); // hier beschreibe ich meinen Zeiger auf 1 / Array in der SPS
// Please note, the format of a file path is device and operating system specific.
// You need to adapt the given path to your environment.
// Example for a Unified Comfort device (Linux OS): /home/user1/data.dat
// Example for a Unified PC-based device (MS Windows OS): C:\Users\Public\data.dat
HMIRuntime.FileSystem.ReadFile("C:\bm\miniring\fill\a\suck.txt", "utf8").then( // damit versuche ich einen tag Text den ich als WSTRING
function(text) { // angelegt habe zu beschreiben
screen.items("myText1").text =text;
HMIRuntime.Trace("Text=" + text);
});
}
das Script habe ich so in einem Beispiel für Textfile einlesen gefunden
Wenn jemend das so schon mal umgesetzt hat wäre ich für einen Tip dankbar
Grüsse