WINCC登录设计教程_第1页
WINCC登录设计教程_第2页
WINCC登录设计教程_第3页
WINCC登录设计教程_第4页
WINCC登录设计教程_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、.建立用户内部变量的建立全局脚本函数EnumUser#pragma code ("UseGen.DLL")#include "usegenap.h"#pragma code ()CMN_ERROR err;CMN_ERROR Error;LPCMN_ERROR error;DWORD countname;char usedata;extern BOOL MyPWGENEnumUsersCallBack ( LPWGEN_USERINFO lpUserInfo ,PVOID lpUser);VOID EnumUser()if(PWGENConnect(&q

2、uot;",&err)PWGENEnumUsers (&countname,MyPWGENEnumUsersCallBack,&usedata,error);SetTagSDWord("count",countname);/Return-Type: BOOL printf("Count:%2drn",countname);elseprintf("PWGENConnect Error :%drn",err);全局脚本函数MyPWGENEnumUsersCallBack#pragma code (&quo

3、t;UseGen.DLL")#include "usegenap.h"#pragma code ()BOOL MyPWGENEnumUsersCallBack ( LPWGEN_USERINFO lpUserInfo, PVOID lpUser)static int n=0;if(n=GetTagWord("count")n=1;elsen=n+1;switch(n)case 16:SetTagChar("username16",lpUserInfo->login);break;case 15:SetTagChar(&

4、quot;username15",lpUserInfo->login);break;case 14:SetTagChar("username14",lpUserInfo->login);break;case 13:SetTagChar("username13",lpUserInfo->login);break;case 12:SetTagChar("username12",lpUserInfo->login);break;case 11:SetTagChar("username11"

5、;,lpUserInfo->login);break;case 10:SetTagChar("username10",lpUserInfo->login);break;case 9:SetTagChar("username9",lpUserInfo->login);break;case 8:SetTagChar("username8",lpUserInfo->login);break;case 7 :SetTagChar("username7",lpUserInfo->login);b

6、reak;case 6:SetTagChar("username6",lpUserInfo->login);break;case 5:SetTagChar("username5",lpUserInfo->login);break;case 4:SetTagChar("username4",lpUserInfo->login);break;case 3:SetTagChar("username3",lpUserInfo->login);break;case 2:SetTagChar("

7、;username2",lpUserInfo->login);break;case 1:SetTagChar("username1",lpUserInfo->login);break;return TRUE;画面窗口属性设置登录按钮脚本#include "apdefap.h"void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)#pragma code("useadmin.dll")#include &qu

8、ot;PWRT_API.H"#pragma code() SetPropChar("main.pdl","pic_denglu","Captiontext","正在验证,请稍后."); if (PWRTSilentLogin(GetTagChar("usernamestr"),GetTagChar("passwordstr")=TRUE) SetTagBit("Visible1",0);SetTagChar ("passwordstr&

9、quot;, ""); else SetPropChar("main.pdl","pic_denglu","Captiontext","密码不正确,请重新输入");注销按钮脚本#include "apdefap.h"void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)#pragma code("

10、;useadmin.dll")#include "PWRT_api.h"#pragma code()PWRTLogout(); /SetTagBit("Visible1",0);/SetTagWord("Picture",0);取消按钮脚本#include "apdefap.h"void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y)#

11、pragma option(mbcs)SetTagBit("Visible1",0);I/O输入输出域设置VB脚本Sub InputValue_OnPropertyChanged(Byval Item, Byval value) Dim obj1,obj2Set obj1=ScreenItems("I01")Set obj2=HMIRuntime.Tags("passwordstr")'obj2.Write obj1.Text,1End Sub用户登录(画面脚本VB)Sub OnOpen() Dim obj1,obj2,obj

12、3,obj4,obj5,namecount,nDim name1,name2,name3,name4,name5,name6,name7,name8,namestr,userstrSet obj1=ScreenItems("combox1")Set obj2=HMIRuntime.Tags("count")obj2.Read namecount=obj2.Valuen=1Do While (n<namecount+1)namestr="name"&nuserstr="username"&nSe

13、t namestr=HMIRuntime.Tags(""&userstr&"")namestr.Readobj1.AddItem namestr.Valuen=n+1LoopEnd Sub组合框脚本Sub Change(ByVal Item) Dim obj1,obj2Set obj1=ScreenItems("combox1")Set obj2=HMIRuntime.Tags("usernamestr")obj2.Write obj1.Text,1End Sub用户显示备注:AP_PBIB出错#i

14、nclude "AP_GLOB.H"#pragma code ("UseGen.DLL")#include "usegenap.h"#pragma code ()void Delay (long int ms);/GSC_NAME:DelayGSC_PROTOTYPE:delay.fctvoid cc_playsound (char* lpszSoundFile);/GSC_NAME:cc_playsoundGSC_PROTOTYPE:cc_playsound.fctvoid EnumUser ();/GSC_NAME:EnumUserGSC_PROTOTYPE:en

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论