EasyBuilder Pro

hello everyone,

I am working on how to auto close pop-up window after login. Every time I login I have to press X button to close window, I just want to auto close window.

I am putting picture for better understanding

Thank you.
 

Attachments

  • Screenshot_1.png
    Screenshot_1.png
    24.7 KB · Views: 20
I'm here for the same reason. Once my user enters their password and hit the 'login' button (default window 70 Login & Logout), if the password was a success, I would like window 70 to close returning the user back to the main screen. Using EasyBuilder Pro and I guess the macro could run every second to evaluate the current users security level. Is this the way ya'll would do it?
 
Here is my Macro that was created to auto change the window if the auto logout occurs. If the Auto logout occurs and the user is on certain windows, they will be returned to window 11 (the main starting window within this app).

This macro was altered to try and get the window 70 Login & Logout to close and switch the user back to window 11 if the login was a success. But its not working. Window 70 is a pop-up window and I don't think the proper window # is getting read back from LW-9050.

Thoughts?



Code:
macro_command main()

short currentclass = 0 // current class - anything other than 0 means a user is logged in
short newwindownumber = 11 // this is the new window we want to direct the user to if they logout or are autologged out
short currentwindownumber = 0 // The current window #


GetData(currentclass, "Local HMI", LW, 9222, 1)    // get the current user class value
GetData(currentwindownumber, "Local HMI", LW, 9050,1) // get current window number


if currentclass == 0 then
    select case currentwindownumber  // = 80 or currentwindownumber = 11) then // if the user is logged out and the currentwindow the screen saver...
        case 11 // The user is logged out but on the main window
            // Do nothing
            break
        case 80 // The user is logged out but on the screen saver window
            // Do nothing
            break
        case 10  // The user is on page 10
               SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
               Beep()
               DELAY(250)
               Beep()
               DELAY(250)
               Beep()
               break
        case 12  // The user is on page 12
               SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
               Beep()
               DELAY(250)
               Beep()
               DELAY(250)
               Beep()
               break
        case 13  // The user is on page 13
               SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
               Beep()
               DELAY(250)
               Beep()
               DELAY(250)
               Beep()
               break
       end select
else
    if currentclass > 0 and currentwindownumber == 70 then
        // The user is logged in and the Login & Logout window is the current window
        SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
    end if
end if
//
end macro_command
 
Here is my Macro that was created to auto change the window if the auto logout occurs. If the Auto logout occurs and the user is on certain windows, they will be returned to window 11 (the main starting window within this app).

This macro was altered to try and get the window 70 Login & Logout to close and switch the user back to window 11 if the login was a success. But its not working. Window 70 is a pop-up window and I don't think the proper window # is getting read back from LW-9050.

Thoughts?



Code:
macro_command main()

short currentclass = 0 // current class - anything other than 0 means a user is logged in
short newwindownumber = 11 // this is the new window we want to direct the user to if they logout or are autologged out
short currentwindownumber = 0 // The current window #


GetData(currentclass, "Local HMI", LW, 9222, 1)    // get the current user class value
GetData(currentwindownumber, "Local HMI", LW, 9050,1) // get current window number


if currentclass == 0 then
    select case currentwindownumber  // = 80 or currentwindownumber = 11) then // if the user is logged out and the currentwindow the screen saver...
        case 11 // The user is logged out but on the main window
            // Do nothing
            break
        case 80 // The user is logged out but on the screen saver window
            // Do nothing
            break
        case 10  // The user is on page 10
               SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
               Beep()
               DELAY(250)
               Beep()
               DELAY(250)
               Beep()
               break
        case 12  // The user is on page 12
               SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
               Beep()
               DELAY(250)
               Beep()
               DELAY(250)
               Beep()
               break
        case 13  // The user is on page 13
               SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
               Beep()
               DELAY(250)
               Beep()
               DELAY(250)
               Beep()
               break
       end select
else
    if currentclass > 0 and currentwindownumber == 70 then
        // The user is logged in and the Login & Logout window is the current window
        SetData(newwindownumber, "Local HMI", LW, 100, 1)        // set LW 100, the word defined in PLC Control Window change to 11
    end if
end if
//
end macro_command

macro_command main()

short login
short currentwindownumber
short newwindownumber = 13

GetData(login, "Local HMI", LW, 8950, 1)
GetData(currentwindownumber, "Local HMI", LW, 9050, 1)

if login == 2 then
SetData(newwindownumber, "Local HMI", LW, 9050, 1)
end if

end macro_command

Try this, it works. The internal register for login is LW-8950. If this register is 2 then the login is successful, if not the register is 3. The periodical execution I've set is 100ms. This code is only to change the window if login is successful tho, just write the rest of your logic.
 
macro_command main()

short login
short currentwindownumber
short newwindownumber = 13

GetData(login, "Local HMI", LW, 8950, 1)
GetData(currentwindownumber, "Local HMI", LW, 9050, 1)

if login == 2 then
SetData(newwindownumber, "Local HMI", LW, 9050, 1)
end if

end macro_command

Try this, it works. The internal register for login is LW-8950. If this register is 2 then the login is successful, if not the register is 3. The periodical execution I've set is 100ms. This code is only to change the window if login is successful tho, just write the rest of your logic.
My bad, LW-8950 is not an internal register but the PLC Control register I'm using.
 
macro_command main()

short login
short currentwindownumber
short newwindownumber = 13

GetData(login, "Local HMI", LW, 8950, 1)
GetData(currentwindownumber, "Local HMI", LW, 9050, 1)

if login == 2 then
SetData(newwindownumber, "Local HMI", LW, 9050, 1)
end if

end macro_command

Try this, it works. The internal register for login is LW-8950. If this register is 2 then the login is successful, if not the register is 3. The periodical execution I've set is 100ms. This code is only to change the window if login is successful tho, just write the rest of your logic.
Nah don't listen to me, I'm tripping right now. This code just changes window when you press "Login" button, this button itself writes '2' in LW-8950 and "Logout" writes '3'. It doesn't matter if the username and password are correct, the window is going to change. I will test out these things later this week.

I apologize for the mistakes.

P.S PLC Control register is 9050, not 8950.
 
Thank you for your participation anyway. It's very much appreciated.

I think the normal window change statement is not working because this login window is a pop-up. LW-9050 (16bit) : current base window ID. Which is working just fine in the other portion of my macro that changes the base window back to the starting window if the auto logout occurs.
 
Just wanted post an answer that I got from tech support. It's good enough for me:

create a Function Key with the “Close window” property. Then, you can place the Function Key and Set Word object for your sign-in button on top of one another in EBPro. This will allow a single button press to both sign the user in and trigger the “Close Window” function.

You’re able to make the Function Key invisible by de-selecting “Use picture”, “Use shape”, and “Use label” in the Function Key’s properties:
 
Just wanted post an answer that I got from tech support. It's good enough for me:
That's not a good idea since you don't have to enter the right credentials, you are always going to close the login window + that you won't be able to tell if the login is successful or not. Gaj, I can send you my program so you can test it out yourself, just give me your email. There is a macro too, long story short I check if the login is successful and change windows if it is. I change windows on logout too. So far It's working good, I can explain you the details in private.
 
Thanks for the concern. I'd like to see the method you used. Can you send it via Direct Message on this forum?

The reason I'm not concerned is because the main user window has most of the controls hidden and secured. Plus there is a 'logged out' message at the bottom when that is appropriate. So if they get the wrong password, they will be right back where they started. But I would like to see a more polished method.
 
Thanks for the concern. I'd like to see the method you used. Can you send it via Direct Message on this forum?

The reason I'm not concerned is because the main user window has most of the controls hidden and secured. Plus there is a 'logged out' message at the bottom when that is appropriate. So if they get the wrong password, they will be right back where they started. But I would like to see a more polished method.
Unfortunately I can't send you the program via Direct Message so I'm just going to post screenshots here.

We will start with the first screenshot - ss_internal.
Firstly, we need to know when the login is successful or not, but how? On ss_internal screenshot we can see both registers for that. I found them on the "Succeeds" and "Password error" texts (I've marked it). I've put notifications on login and logout buttons - login sets on LB-0 and logout LB-1 (both before writing).

Moving on the macro.
Pretty simple if logic. I use In and Out for the notifications mentioned above - because I need to turn off those bits. ligin is used for watching over LW-bit 895100 which is execution result. This bit gets "On" when you login or logout. Interesting part is that when you login it just turns "On" and "Off" instantly, but when you logout it stays "On". That's why I turn if off in the second "if". LW-9050 is PLC Control register.

Hope it helps. If you have ideas for improvement or any questions feel free to reach me.
 

Attachments

  • ss_internal.png
    ss_internal.png
    14 KB · Views: 59
  • ss_macro.png
    ss_macro.png
    52.9 KB · Views: 68

Similar Topics

I'm working on an interface to load, save, and change settings for a machine. Each setting uses an input box. Some are ascii and some are...
3
Replies
1,481
Views
Hello, I'm a student studying EB Pro, and I'm not sure what I'm doing wrong at the moment. The HMI I'm building is a gauge with three lights...
7
Replies
2,572
Views
Any takers? Just got done building a screen from compactlogix. Unfortunately the rest of the facility's controllers are in the SLC family. I...
1
Replies
900
Views
Hey everyone I downloaded EasyBuilder Pro today but after a few minutes it just crashes. Does anyone know why?
6
Replies
2,360
Views
I am trying to use a word lamp to display robot status with 17 different states. I cannot modify any shape on states 2-16. I can change the shape...
4
Replies
2,527
Views
Top