You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old May 15th, 2018, 02:30 PM   #1
travisroberts88
Member
United States

travisroberts88 is offline
 
Join Date: Aug 2017
Location: Navarre, Ohio
Posts: 16
Factory Talk View Studio SE - Auto Login/Logout

I will try to clarify this as well as I can here and can do my best to clarify further if needed.

I have a plant where I have about 5 or 6 areas. The plant has all SE screens and a main menu. Certain users can access the entire plant of screens, others have access to the specific area. The unique situation I have is this, if a supervisor or engineer log in and either logout, or auto logout the DeskLock application after a set number of minutes, I want the startup macro login to login again. For example, if the supervisor logs in to the filler area, logs out (or auto logout on versaview after 5 minutes) I want the FillerArea startup macro (or FillerArea login macro if needing to make another) to run and then trigger a login for the FillerOperator user. This would also be in each other area. The main thing here is that there is only one header screen with the Login Logout buttons. Essentially I want the login button to run a macro on the specific client since I am working with 5 or 6 areas, with about 4 screens or more in each area.
  Reply With Quote
Old May 15th, 2018, 04:04 PM   #2
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,653
http://www.plctalk.net/qanda/showthread.php?t=95319

The above thread may help you out.
Regards,
__________________
Garry
https://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old May 15th, 2018, 04:36 PM   #3
travisroberts88
Member
United States

travisroberts88 is offline
 
Join Date: Aug 2017
Location: Navarre, Ohio
Posts: 16
Quote:
Originally Posted by gclshortt View Post
http://www.plctalk.net/qanda/showthread.php?t=95319

The above thread may help you out.
Regards,
I did see this, I don't think it is what I am looking for. I don't want to to log into a "view only" user. I actually want to to log into one of 6 startup macros I created. This is because each area has different permissions. So Filler would logout and log in as the FillerOperator, capping would logout and log in as CappingOperator on two different sides of the plant. There is only one main menu with one Logout button that would need to do this so I don't have a ton of screens. Pretty much I wish in the SE environment in studio I could have the Logout button run the action of Login (startupmacro"x") where it would be Login FillerMacro or Login CappingMacro, etc. I can tell it to Login operator operator but I don't want it to do that sadly. I want it to login the macro that is on the specific client, as in, I want the Logout to Login a user on that particular client that is the default for the client, not the screen.
  Reply With Quote
Old May 15th, 2018, 06:32 PM   #4
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,668
You'll probably need to get VBA involved. FTView can't tell which client it's running on - you'll need to use VBA to get the PC name, and use that to decide which macro to run
  Reply With Quote
Old May 16th, 2018, 01:33 PM   #5
travisroberts88
Member
United States

travisroberts88 is offline
 
Join Date: Aug 2017
Location: Navarre, Ohio
Posts: 16
Quote:
Originally Posted by ASF View Post
You'll probably need to get VBA involved. FTView can't tell which client it's running on - you'll need to use VBA to get the PC name, and use that to decide which macro to run
Any idea what command grabs that PC name. Application.GetHMIServerComputerName is the only one I can think of that utilizes computername in its call, but this does not work.
Example of my code would be:

NOTE: THIS IS USING THE RSVIEW32/SE IDLE DETECT CONTROL ACTIVE X CONTROL

Private Sub RSView32SEIdleDectectControl1_EnterIdleState()
Dim computername As String
computername = <The function to grab the computer name>
Select Case computername

Case "<Computer namehere(ie. Client2 [full qualification if needed])>
Select Case CurrentUserName()
Case "Supervisor"
Application. Login "username", "password"
Application.LoadDisplay "Main Menu"
Case Else
End Select
Case <Second computer here(ie. Client4 [full qualification if needed])>
Select Case CurrentUserName()
Case "Supervisor"
Application.Login "username2", "Password2"
Application.LoadDisplay "Main Menu"
Case Else
End Select
Case Else
End Select

This gives me one master supervisor user name that no matter what client I am on I can auto logout to that clients specific login credentials.
I can accomplish this if I make multiple usperviosr accounts and have the case be dependent on the user logged in. But I want it dependent on the client it is on. I.E. If supervisor is on client4, after the activex timeout of 30 seconds, it auto logs in as usernamex and passwordx
  Reply With Quote
Old May 16th, 2018, 04:53 PM   #6
travisroberts88
Member
United States

travisroberts88 is offline
 
Join Date: Aug 2017
Location: Navarre, Ohio
Posts: 16
We were able to sort this out. The embedded commands hardly work in the FTV environment, shocking I know!
Here is an example of how I worked around it in VBA:

Dim compname As String
compname = Environ$("computername") 'We use the Windows environment variable "computername" to resolve the name of the device that's running our code. It is accessed via the Environ$(string environmentVariableName) function.

Select Case compname

Case "Client4"

Select Case CurrentUserName()
Case "supervisor"
Application.Login "operator", "operator"
Application.ExecuteCommand "Display ""Main Menu"""
Case Else
End Select


Rinse and repeat for more clients
  Reply With Quote
Old May 16th, 2018, 06:56 PM   #7
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,668
You got it, that's exactly what I would have suggested. I've got an application that does a similar thing, in that all clients display the same overview, but at startup each client checks it's own computer name and hides the controls for areas of the plant that aren't related to it. So all clients can see the whole line, but only the client in the specific area can control it.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
How to Backup and Restore Factory Talk view SE Project for Editing Tim Ganz LIVE PLC Questions And Answers 6 June 6th, 2018 04:15 PM
Connection Problem with Factory Talk View Studio Version 7 with compact Logic L30ER khaiseng82 LIVE PLC Questions And Answers 1 October 9th, 2013 08:20 AM
Factory Talk View Studio - ME VBA support? crawler009 LIVE PLC Questions And Answers 3 September 5th, 2013 12:13 PM
Factory Talk View SE and MSCOMM mspath LIVE PLC Questions And Answers 1 August 26th, 2012 09:02 AM
Using Factory Talk View Studio kandymann LIVE PLC Questions And Answers 7 February 8th, 2011 03:16 AM


All times are GMT -5. The time now is 04:50 PM.


.