10/3/2015 12:36 PM | |
Joined: 9/23/2005 Last visit: 11/11/2024 Posts: 4351 Rating: (1452)
|
“Simple Samples” are small projects that demonstrate simple features. The target is give a quick overview about the theme and be used as start point for related discussions. Follow there are a short description and the configuration main steps.
Description:
This simple sample shows hot to logon a user in diferent ways: By Logon system dialog (click in a specific object) By button (user / password defined by variables) By button (predefined user / password)
Requirements: WinCC Professional V13 SP1.
Project with a minimum configuration (stop button, tags, user, user groups, authorizations, etc. See “WinCC Professional V13 SP1 – Simple Sample: Users – access restriction” https://support.industry.siemens.com/tf/br/en/posts/135189/).
Configuration main steps:
Logon system dialog (click in a specific object, e.g. button)
Button (user / password defined by variables)
#include "GlobalDefinitions.h" void OnClick(char* screenName, char* objectName, char* propertyName) { //Insert the code starting here #pragma code ("useadmin.dll") #include "PWRT_api.h" #pragma code() LPTSTR pLogin = GetTagChar("HMI_User_Name"); // Nome do usuário LPTSTR pPassword = GetTagChar("HMI_User_Password"); // Password PWRTSilentLogin(pLogin,pPassword);
}
Button (predefined user / password)
#include "GlobalDefinitions.h" void OnClick(char* screenName, char* objectName, char* propertyName) { //Insert the code starting here
#pragma code ("useadmin.dll") #include "PWRT_api.h" #pragma code()
PWRTSilentLogin("John","111111");
}
Logoff by button:
#include "GlobalDefinitions.h" void OnClick(char* screenName, char* objectName, char* propertyName) { //Insert the code starting here
#pragma code ("useadmin.dll") #include "PWRT_api.h" #pragma code() PWRTLogout(); }
References: Manual WinCC Professional V13.0 https://support.industry.siemens.com/cs/br/pt/view/92323076/en
Online helps system WinCC Professional V13.0 SP1 https://support.industry.siemens.com/cs/br/pt/view/109096785/en
FAQ Which VBS information and VBS programming tools are there in WinCC (TIA Portal)? https://support.industry.siemens.com/cs/br/pt/view/59885894/en
Tips and tricks for creating scripts in WinCC (TIA Portal) https://support.industry.siemens.com/cs/br/pt/view/57132412/en
Project: Attached as project.zip
AttachmentData.zip (255 Downloads) |
Denilson Pegaia |
|
3/19/2020 1:43 PM | |
Joined: 3/6/2014 Last visit: 2/16/2024 Posts: 4 Rating: (0) |
Hi, It still does not work ?... I am in V15.1. I have the impression to waste my time this this function .... Best regard |
Follow us on