Showing results 1 to 8 of 8

Thread: AutoLogout

  1. #1
    hansvanzijp Gast

    Default AutoLogout

    Hello,

    I try to change the AutoLogout mode during runtime.
    VBA Code:

    Public Sub enableautologoff()
    thisProject.DynProperties("AutoLogout") = True
    thisProject.DynProperties("AutoLogoutTime") = 1
    thisProject.Variables.Item("logoutstate").Value = "Enabled"
    End Sub

    Public Sub disableautologoff()
    thisProject.DynProperties("AutoLogout") = False
    thisProject.Variables.Item("logoutstate").Value = "Disabled"
    End Sub

    Public Sub ShowAutologoffStatus()
    Dim strText As String
    Dim IsOn As Boolean
    Dim Settime As Long

    IsOn = thisProject.DynProperties("AutoLogout")
    Settime = thisProject.DynProperties("AutoLogoutTime")
    strText = "Auto Logoff = " & str(IsOn) & " ,Tijd = " & str(Settime)
    Debug.Print strText

    End Sub


    I see the string variable changing, so the macro's are executed, but the state remains as defined in the project properties.
    In the sub ShowAutologoffstatus the items are always returning "empty"
    What's wrong?

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: AutoLogout

    Most of the DynProperties are only available in the Editor - not in the Runtime (DynProperties for i.e. Functions are available).
    As you can see for the thisProject.DynProperties("AutoLogout") you can not read nor write the value.

    So dynamically switch on/off the "Automatic logout" via VBA is not possible.

    Maybe with zenon >= 6.50 a systemvariable exists which also shows the time without any interaction... but I'm not sure ... I'will check this on monday.

    Regards & nice we,
    Herbert

  3. #3
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: AutoLogout

    In zenon >= 6.50 there exists a system variable called "Time without operation" [s] (category System information).

    To enable/disable the AutoLogout functionality on demand you can do the following:
    - disable the "automatical log out" feature at the project
    - create a rema in which you are evaluating the system variable "Time without operation"
    -> if the defined time exceeds the actual time the execute the logout function

    Regards,
    Herbert

  4. #4
    hansvanzijp Gast

    Default Re: AutoLogout

    Thanks for your help.
    You write:
    “As you can see for the thisProject.DynProperties("AutoLogout") you can not read nor write the value.”
    But where can I find that?
    I have found the DynProperties in the 6.50 help, (automation interface->project->DynProperties) but there is nothing about read or r/w and editor/runtime.

  5. #5
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: AutoLogout

    But where can I find that?
    I have found the DynProperties in the 6.50 help, (automation interface->project->DynProperties) but there is nothing about read or r/w and editor/runtime.
    -> we are working on improving the help documenation
    -> due to there are more than 40.000 DynProperties available in zenon (Editor/Runtime) this will take some time to evaluate which are read-/write-/available for the Editor/Runtime

  6. #6
    hansvanzijp Gast

    Default Re: AutoLogout

    Quote Originally Posted by herberto View Post
    In zenon >= 6.50 there exists a system variable called "Time without operation" [s] (category System information).

    To enable/disable the AutoLogout functionality on demand you can do the following:
    - disable the "automatical log out" feature at the project
    - create a rema in which you are evaluating the system variable "Time without operation"
    -> if the defined time exceeds the actual time the execute the logout function

    Regards,
    Herbert
    Thanks,
    We will use the system var.

    Kind Regards,
    Hans van ZIjp.

  7. #7

    Default Re: AutoLogout

    Quote Originally Posted by herberto View Post
    In zenon >= 6.50 there exists a system variable called "Time without operation" [s] (category System information).

    To enable/disable the AutoLogout functionality on demand you can do the following:
    - disable the "automatical log out" feature at the project
    - create a rema in which you are evaluating the system variable "Time without operation"
    -> if the defined time exceeds the actual time the execute the logout function

    Regards,
    Herbert
    Hello Herbert,

    I tried to use the same method and it works correctly.Thanks!
    However, when i logout(in my condition execute login without password function to login as user "visitor") i want to write to CEL "Automatic logout". I wrote the text("Auto Logout after 30min") to the REMA and it worked,i saw in the CEL. But now even if i am logout already(in my condition login as user "visitor") after timeout time limit text("Auto Logout after 30min") text is written in CEL.
    How can avoid this problem?

    My question is how can i use your Auto Logout method and not to write to CEL(or not to logout) when i am logined with user "visitor"??I just want to auto logout when i am logined as user "operator".
    Thanks!

  8. #8
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: AutoLogout

    if you want to have this auto logout only for a specific user then following should work:

    - system variable (current user)
    -> create a reactionmatrix where you configure that specific user (visitor)
    -> at this specific user (rema state) you link a setvalue function which sets a internal bool variable to 1 (i.e bVarVisitor)
    -> link this rema to that system var


    - system variable ("Time without operation" )
    -> create a reactionmatrix where you configure the spefic inactive time (i.e. 30min)
    -> at this rema state you link a setvalue function which sets a internal bool variable to 1 (i.e. bVarTimeInactive)
    -> link this rema to that system var


    - mathematik variable where you put both internal bool variables from above and in the formular you put then X01 AND X02
    -> at the limit 1 of the mathematic variable you then link the logout function

    regards,
    herbert


Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •