PV+ Auto Logout based on screen

phuz

Member
Join Date
Jun 2008
Location
Mohnton, PA
Posts
1,044
I got an odd request from a customer wanting to perform an auto logout if certain screens are left active, but not others. The auto logout feature in Studio is rather limited, so I was thinking if they used global connections for screen control, they're half way there, but there is no auto logout command that can be used in a macro.................is there? :D
 
Not exactly.

Client Side you can fire a Macro with Login.

I always create a LOCAL HMI user named HMI_Default with password HMI_Default that has nothing but "view only" permissions (as governed by CurrentUserHasCode() functionality.

Then instead of "logging out" I just run

Code:
login HMI_Default HMI_Default

Where the syntax is login username password

If you want to do this event based on a per client basis, then you will need to do a bit of VBA code to make sure things are executed client side.

The best way to do this is to have a background screen that runs on each client that holds VBA code. Here is a copy and paste of my post from this thread, slightly altered for you. --> http://www.plctalk.net/qanda/showthread.php?t=92425


====

You can run an EVENT file that will execute things "globally" (from the server). However, lots of commands CANT be ran - because they don't know where to execute. Example - "Display XYZ" can NOT be ran from an EVENT file because it doesn't know where to execute.

Generally I have a "background" screen that runs on all clients that is cached and running in the background.

To your startup macro add the following:

Display BackgroundScreen /ZA

Then have all of your code on the BackGroundScreen.

Hope that helps.
===

On the BackGroundScreen, have a Numeric Display that points to the PLC Tag for timer for screen, or condition, or whatever you want.

Expose the Numeric Display to VBA Code

Have your code say:

Code:
Private Sub NumericDisplay1_Change()
On Error GoTo ErrorHandler

If Not IsError(NumericDisplay1.Value) Then

    If (NumericDisplay1.Value = 1) Then
        ExecuteCommand ("Display Name_Of_Window")
    End If
    
End If

ErrorHandler:
Exit Sub
End Sub

You can change the ExecuteCommand to fire a macro, or even do the login directly. Examples are:

Code:
   If (NumericDisplay1.Value = 1) Then
        ExecuteCommand ("login HMI_Default HMI_Default")
    End If

Code:
    If (NumericDisplay1.Value = 1) Then
        ExecuteCommand ("MacroName")
    End If

Hope that helps!
 
Commando, I was referring to FTME. I believe that is what the OP is using. But, that's speculation on my part. I was going off of the limited auto logout comment he made and Global Connection Screen Control.
 
Yes, sorry for not clarifying.
This is ME, so using that VBA isn't an option otherwise this would have been solved. :D
 
No, there is no logout command for the PV+. Only the push button.
There is the auto-logout feature in the Project Settings. Use that.

To do what you are asking is not (easily) possible on a per screen basis. But you can do it on a per user basis; not straight forward either though.

  1. Add screen security to the screens you want to auto-logout
  2. Use the remote display number in Global Connections
  3. Create a Logout macro that sets the Remote Display Number to change displays to a Login screen. The login screen will need a startup macro to clear the Remote Display Number to 0.
  4. Enable the auto-logout feature in Project Settings, but do not enable the "return to graphic" feature.
  5. Create user(s) with access to those secured screens, and assign your logout macro.
  6. Make sure the default user does not have access to those screens.


So, anytime a "secured" user logs out (manually or auto-logout) their logout macro will run and change screens to the login screen. For any other user that does not have the logout macro assigned, nothing will happen. The user is logged out but no screen change occurs.

Let me know if that works out.
 

Similar Topics

Hello all, I am looking for a way to have a user get logged out after an X amount of time because to default so that user privilages are no...
Replies
4
Views
589
I have a FactoryTalk SE 9.00 application which monitors and controls a batch application in two rooms. When running at full capacity each room has...
Replies
3
Views
729
Hello, I am facing few problems with my FT VIEW 11 HMI (The PLC is SLC Connected via ethernet driver): 1. Is it possible auto logout to login to...
Replies
0
Views
1,075
Hello, I have developed a Factory Talk View SE application and do not have any users or logins enabled. The system is auto logging out after...
Replies
1
Views
4,365
Ok guys I have worked with the Panelveiw plus, and they have it where you can have the logged in user, logged out after certain set of time after...
Replies
0
Views
961
Back
Top Bottom