Jump to content

FT View - Display curent logged in user


Recommended Posts

Posted
I am wiriting a Factory TAlk applicaiton and using FActory TAlk Studio local edition version 6.0 for a standalone application that will reside on a Versaview workstation. I have the need to display the currenlty logged in user and I am having trouble. For testing purposes I am doing the following: Current User: s......s So I have a string variable and the tag that it is linked to is system/user. All I get on the display is ????????. I am able to display all other vairables (both string and numeric), and OPC data from a PLC, just not the logged in user. I also have a button where I can changed the user, and the login is always successful as seen in the FT diagnostics, but it just does not appear to want to display the user name, although I know the application has that information. I do not have a fixed number of characters so I assume that it would just try and display the entire string if it can, regardless of the length. Am I missing something here? Any help is certainly appreciated.

Posted
Lars, thanks for the quick reply. Well , that worked but since that is a property of the current application, I had to write VB code to get to it. This means that I will need to create an event to trigger it to update, such as something like OnUserChange. I was hoping for something that would just always display the current user and not force me to write any custom code. If anyone knows of anything that will work in that manner please let me know, but for now I will proceed with the VB method.
Posted
Is it me or is there a seriouss disconnect in Factory Talk between "Macros" and VBA code for a display. In Office Applications (Excel,...), these are one in the same. In Factory Talk, they are different and I am struggling to figure out how to accomplish what I want. I simply want to display the currently logged in user on the display. For some reason the built-in system\user will only display ?????? on the display so it was suggested that I use the CurrentUserName() method to get this. So I go into VBA code for the display and in my Animation Start I place the following: Text2.Caption = Application.CurrentUserName() Works perfect!. Only catch is that it only works on startup and will not update when a new user logs in. So I need to create some kind of event (using timed for this example) so I wnat that Caption to be updated every two seconds. BACK TO FT APPLICATION and create and event that triggers every two seconds. Easy enough. What do we want to do when this event occurs, we want to run the Application.CurrentUserName, but how do I call that since I am no logner in the VBA world and I do not have access to this (or I don't know how) inside of the worlld of FT application "macros". MAybe jsut a little confused but ideally I would like t oopen up the world of objects that appears inside the "True" VBA code for hte display for macros inside of the application. Am I way off here?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...