Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

8/8/22, 11:43 AM login dialog via vbs - Entries - Forum - Industry Support - Siemens

login dialog via vbs

Created by: Avant at: 5/8/2010 12:30 PM (14 Replies)


Rating (1)
Thanks 2

Actions New post

15 Entries Entries per page:


10
|
all   |   1
| 2  | 

5/8/2010 12:30 PM Rate (0)


Avant hi
  which function in vbs call login dialog?
Posts: 139
with thebest regards
Rating:

(0)

Suggestion To thank Answer Quote  

5/10/2010 11:22 AM Rate (0)


Romulus Hi

Perhaps you canuse the C standard function: PASSLoginDialog ?

Silver Member

Joined: 1/4/2010
Last visit: 11/9/2021
Posts: 650
Rating:
Regards
(38) Romulus

Please give me answer if it works or if i can help you again.


Sorry if my english isn't so comfortable.

Suggestion To thank Answer Quote  

6/13/2010 12:13 PM Rate (0)


Avant thanks
  but i want to use just vbs no by c_action.
Posts: 139
Rating:

(0)

Suggestion To thank Answer Quote  

6/16/2010 9:09 AM Rate (0)


Romulus Hi

I dont't know how.

But there is a way to call c functions in VBS:


WinCC ToolWinCC Script Connector.
Here some info about this.
http://www.industry.siemens.de/wincc/wincc/html_76/index.asp?
Silver Member
menu=3&cont=3_11&rel=allgemein&Index=entry
Regards
Romulus

Joined: 1/4/2010 Please give me answer if it works or if i can help you again.
Sorry if my english isn't so comfortable.
Last visit: 11/9/2021
Posts: 650
Rating:
Regards
(38) Romulus

Please give me answer if it works or if i can help you again.


Sorry if my english isn't so comfortable.

Suggestion To thank Answer Quote  

https://support.industry.siemens.com/forum/WW/en/posts/login-dialog-via-vbs/43290 1/3
8/8/22, 11:43 AM login dialog via vbs - Entries - Forum - Industry Support - Siemens

6/16/2010 1:32 PM Rate (0)


Yolov hi,

You can not use VBS to open login dialog. You can do it from ANSI C as Romulus
said.

It is possible if you use SIMATIC Logon. Check FAQ site - there is very ugly
looking VBS example how you can do that for SIMATIC Logon.

Bronze Member
Regards

Joined: 2/22/2006
Last visit: 8/4/2022
Posts: 284
Rating:

(35)

Suggestion To thank Answer Quote  

7/15/2010 8:31 AM Rate (0)


kukukk Hy!

I have used the following solution to login/logout via VBS:

I have 2 buttons ("Button_Login" for login and "Button_Logout" for logout) with the
following C script on Fill Level Change event:
(You can make that buttons invisible, and you can use another event...)

For login button:


#pragma code ("useadmin.dll")
#include "PWRT_api.h"
Bronze Member #pragma code ()
SetFillingIndex(lpszPictureName, lpszObjectName, 0);
PWRTLogin ('c');

For logout button:


Joined: 9/27/2005 #pragma code ("useadmin.dll")
#include "PWRT_api.h"
Last visit: 8/13/2020 #pragma code ()
SetFillingIndex(lpszPictureName, lpszObjectName, 0);
Posts: 133 PWRTLogout ();
Rating: And I have the following VBS code (you have to change the screen number according to
your screens...):
(5)
For login:
Sub Login(Item)
Dim objScreen
Dim Button
Set objScreen = HMIRuntime.Screens(2)
Set Button = objScreen.ScreenItems("Button_Login")
Button.FillingIndex = 50
End Sub

For logout:
Sub Logout(Item)
Dim objScreen
Dim Button
Set objScreen = HMIRuntime.Screens(2)
Set Button = objScreen.ScreenItems("Button_Logout")
Button.FillingIndex = 50
End Sub

I hope this help

Best regards,
kukukk

Suggestion To thank Answer Quote  


This contribution was helpful to
Saruca

9/27/2010 3:35 PM Rate (0)


r2407 Dear kukukk,
  Thank you for your solution, however I should say that your code is cmpletely true
Posts: 111
for C, but I don't know why the VBS code doesn't work at all. Since I am
Rating: basicallymore comfortable with Visual Basic, I refer to program with VBS.
(0) Honestly, I didn't understand your program in C and only copy it in my program.
I would be pleased if you helr to find out what is the problem of VBS part.
Tanks.
Yours Faithfully
Reza

Suggestion To thank Answer Quote  

9/27/2010 3:44 PM Rate (0)

https://support.industry.siemens.com/forum/WW/en/posts/login-dialog-via-vbs/43290 2/3
8/8/22, 11:43 AM login dialog via vbs - Entries - Forum - Industry Support - Siemens
9/27/2010 3:44 PM Rate (0)
kukukk Can you post your sample project? And I will try to correct it...

Bronze Member

Joined: 9/27/2005
Last visit: 8/13/2020
Posts: 133
Rating:

(5)

Suggestion To thank Answer Quote  

9/28/2010 8:08 AM Rate (0)


r2407 Dera kukukk,
  First of all, thanks alot for your attention to my problem. I simpely copied your VBS
Posts: 111
codes to the mouse action of my button, but I didn't realized what was your
Rating: meanwhen yousaid "(you have to change the screen number according to your
(0) screens...)"
In my project, I have created 6 screens, and the screen that I have placed these
Login Buttons is first screen that I have named it "home.pdl".

For login:
Sub Login(Item)
Dim objScreen
Dim Button
Set objScreen = HMIRuntime.Screens(2)
Set Button = objScreen.ScreenItems("Button_Login")
Button.FillingIndex = 50
End Sub

What shall I put within bracket, 6, 1 or home? (Set objScreen = HMIRuntime.Screens(2) ??)
Is Button_Login a button in Library or an object name that I have to place in my screen.

I look forward to hearing from you soon.


Reza2407

Suggestion To thank Answer Quote  

9/28/2010 8:52 AM Rate (0)


kukukk
I have HMIRuntime.Screens(2), because the screen on which the buttons are, is in a
PictureWindow. If you don't have any PictureWindow I think you should use 1 for screen.
Maybe it should work with HMIRuntime.Screens("home"). You can find more information
in WinCC help...

The Login_Button is an object from Object Palette -> Windows Objects -> Button.
By default Graphics Designer gives a name lake Button1, Button2... (It depends
on how much Button object have you placed on your screen. With every object it
is incremented) But I have changed it's name to Login_Button.
Bronze Member
I hope this helps.

Best regards,
kukukk
Joined: 9/27/2005
Last visit: 8/13/2020
Posts: 133
Rating:

(5)

Suggestion To thank Answer Quote  

15 Entries Entries per page:


10
|
all   |   1
| 2  | 

 
© Siemens AG 2009-2022 - Corporate Information | Privacy Policy | Cookie policy | Terms Of Use | Digital ID | Forum Terms

https://support.industry.siemens.com/forum/WW/en/posts/login-dialog-via-vbs/43290 3/3

You might also like