屏的型號是TK6071ip的,  我試過用宏,但是不知道為什么,如果用宏的話, 只用輸入密碼前4位 就可以登陸了,  請大神看看。
在觸摸屏添加的密碼輸入地址是  LW0   
macro_command main()
char M[20]                                      //
定義M 是一個20個字的 字符串數組char password_input[20]                //定義password_input 是一個20個字的 字符串數組
 int A
 int password_clean=00000000 
 int page_main
 int page_system
 int password_admin
GetData(M[0] "Local HMI" rw,10,20) 
SetData(M[0] "Local HMI" rw,20,20)
 GetData(page_system "Local HMI" lw,9502,1)     //獲取用戶密碼2的值放到  page_system  里面 
 GetData(page_main "Local HMI" lw,9504,1)       //獲取用戶密碼3的值放到    page_main   里面
GetData(password_input[0] "Local HMI" lw,0,20)     //獲取LW0里面的值,將值放到password_input里面。
if  password_input[0] == M[0] then                            //如果password_inpu  等于M  ,就把page_system 里面的值寫入到lw9220       
        SetData(page_system "Local HMI" lw,9220,1)                  
    else if  password_input[0] == password_admin then    //如果 password_inpu  等于password_admin    就把page_system 里面的值寫入到lw9220       
        SetData(page_main"Local HMI" lw,9220,1)       
    end if 
  GetData(A,"Local HMI" lw,9050,1 )     //獲取觸摸屏當前 頁面地址
   if A == 11     then                                 //如果等于11,  就將password_clean 寫入到lw0.   
   SetData(password_clean "Local HMI" lw,0,1) 
    end if   
end macro_command
[ 此帖被zy123518763在2019-01-13 10:16重新編輯 ]