Twincat3 HMI Export Interface richtig benutzen

C12-IT

Level-1
Beiträge
1
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo Zusammen,

Ich versuche für das TE2000 HMI von Beckhoff eine Information aus dem HMI-Server zu bekommen.
Ich möchte, dass auf dem Touchpanel die verbleibende Zeit bis zum automatischen Logout des Benutzers angezeigt wird.


Hier habe ich folgende Funktion dazu gefunden:
https://infosys.beckhoff.com/index....e2000_tc3_hmi_engineering/3921961739.html&id=


Der Wert "autoLogOffMilliSeconds" hört sich nach dem an, was ich suche. Mein Problem ist, dass ich nicht weiß, wie man die Export Interface Funktion einsetzt. So in etwa hätte ich es mir in Javascript vorgestellt. Aber da bekomme ich einen Fehler in der Console: "TypeError: TcHmi.Functions.TcHmiProject2.BeispielExportInterface is not a function". Vielleicht weiß Jemand, wie man diese Interfaces verwurschteln muss und kann mir ein Beispiel zeigen.

Code:
(function (/** @type {globalThis.TcHmi} */ TcHmi) {
    var Functions;
    (function (/** @type {globalThis.TcHmi.Functions} */ Functions) {
        var TcHmiProject2;
        (function (TcHmiProject2) {
            function BeispielExportInterface() {
                export interface userConfigOnServer {
                    state: TcHmi.Server.userConfigState;
                    userIsInGroups: string[];
                    name: string | null;
                    domain: string | null;
                    locale: string | undefined;
                    timeFormatLocale: string | undefined;
                    timeZone: string | undefined;
                    clientIp: string;
                    session: string | null;
                    clientCertificate: string | null;
                    autoLogOffMilliSeconds: number | null;
                    defaultAuthExtension: string;
                }
                var LogOffZeit;
                LogOffZeit = userConfigOnServer.autoLogOffMilliSeconds;
                return LogOffZeit;
            }
            TcHmiProject2.BeispielExportInterface = BeispielExportInterface;
        })(TcHmiProject2 = Functions.TcHmiProject2 || (Functions.TcHmiProject2 = {}));
       Functions.registerFunctionEx('BeispielExportInterface', 'TcHmi.Functions.TcHmiProject2', TcHmiProject2.BeispielExportInterface);
    })(Functions = TcHmi.Functions || (TcHmi.Functions = {}));
})(TcHmi);

Liebe Grüße


Alex
 
Zurück
Oben