QQ登录

只需一步,快速开始

威纶触摸屏如何使用拼音输入中文

  [ 复制链接 ]


例程功能介绍:
威纶触摸屏默认不带中文输入功能,官方回复是没有此功能。但我们可以自己编写代码来完成中文输入的功能,
此帖通过配方寄存器配合宏指令来实现类似拼音输入功能。


我们知道世界上语言众多,但在电脑里都可以通过Unicode编码查询获得。
通过此表可以查询字母,数字,也可以查询汉字。每个查询结果对应一个编码值。
例如
<啊>对应一个十进制数21834,
<挨>对应25834。
我们在触摸屏里可以将字符输入元件资料格式设置为UNICODE,
内容设置为21834就会显示汉字<啊>。
汉语里常用文字约3700,这些汉字按拼音排序后,
我们将其对应编码保存到配方寄存器里,就能够通过宏指令调用与显示。

我们事先已经制作好了带拼音输入汉字功能的界面,如下图。
2019-09-15_131615.jpg

通过界面字母输入拼音后,例如拼音gong。
可点击(Enter)回车键,程序会通过宏指令根据输入的拼音将汉字显示出来供用户选择,这是模拟电脑的输入法。
一次仅能显示9个汉字,更多汉字可以通过右上角两个小箭头左右滚动显示与选择其他汉字。
显示的汉字可以点击选择,并会在窗口正上方逐一显示出已选择的汉字。

点击CLEAR键可将全部输入内容都清空,以便重新输入。
点击确认键,拼音窗口退出。
并将选择的全部汉字显示到界面的字符显示元件上。
例程效果可以查看视屏演示,界面与功能扩展有要求的话,可下载附件参考着使用。
另外我还在此版本上,依照网友的个性要求,
参考电脑搜狗拼音输入法的操作,扩展了一些功能。
支持中文输入,英文大写输入,英文小写输入,符号输入。shift键用于切换输入方法。
在另一篇帖子有介绍说明:
威纶触摸屏通过拼音输入中文通过三菱PLC
https://www.gkbc8.com/thread-15921-1-1.html
网友在回复时有要求分享出来供下载,
所以在回复网友时我分享了源代码供大伙下载学习。
具体可以看看去。

涉及附件下载地址如下。
请点击此处下载

请先注册会员后在进行下载

已注册会员,请先登录后下载

文件名称:威纶触摸屏如何使用拼音输入中文.rar 
文件大小:761.54 KB  售价:18金币
下载权限: 不限 以上或 VIP会员   [购买捐助会员]   [充值积分]   有问题联系我




例程网友反馈:
例程是自助下载与使用,经众多网友下载参考使用,基本OK。
近期有一个网友反馈例程在电脑模拟正常,下载到屏出现乱码。
例程我是使用V6.04.1版本编写,并一同在电脑与屏上测试,都正常实现拼音输入功能的。
经远程帮助发现确实是有乱码,帮忙处理后正常使用,这是有偿技术服务


如果遇到乱码问题,也可自己处理的,在编译界面上,官方是有文字提示方法的:
更改字库。

经此网友反馈后,我已更新例程,程序使用的字库已经统一修改为官方所指定的,下载到屏忆不会出现乱码。
如果你也遇到下载后,也出现乱码问题,
可以参考我写的另一帖子,关于字库设置问题:
威纶通触摸屏控件使用unicode编码显示中文

经另一位网友反馈,在最新版本编程软件使用例程,有出现不显示问题。
也包了一个红包让我远程看了下,编程软件版本是最新的V6.0402,
发现界面文本内容,边框框都不显示的,很奇怪。
综合以往使用各个编程软件版本的经验,不是程序闪退就是格式出错的,所以想必又是新版本的BUG.
我在虚拟机测试了下此网友最新版本的编程软件,问题无法重现,使用例程对应的版本V6.04也一切正常。
怀疑是新旧版本同时安装了,有冲突问题吧,叫他尝试都卸载了,安装其他版本,先不做新版本的小白鼠。
网友自己操作后,一切正常。

所以也得注意编程版本号,例程是我用V6.04.1版本编写,遇到问题可以参考着解决.
威纶编程软件版本实在太多,官方每个版本感觉不是一伙人写的,没有功能规划与测试就发布供下载使用。
每个版本编程软件BUG特别多,我研究过编程软件逆向破解,编程软件相关的BUG遇到挺多。
各版本兼容性差,反编译文件时有不识别现象。
在尾部回复也有相关回复。

例程使用方法:
下载解压后,将exob格式程序文件进行反编译,或将cmtp格式文件解压缩后,打开编辑。
再将配方文件放置于编程软件安装目录下,如D:\Program Files\EBpro\HMI_memory\recipe。
便可在电脑离线模拟查看效果。

2019-09-14_182239.jpg


例程编写过程:
例程的编写过程可以选择简单看看,了解就好,以便自己能按需求修改使用。

首先是将按拼音排序后的汉字编码保存起来,存到文件。
如上图,这个可以自己在百度搜索下载,很多。
总之准备一UNICODE拼音排序文件就好,后缀制作配方文件用。


然后再将结果文件通过触摸屏配方编辑工具导入来制作配方文件,可能很多新手朋友不了解此文件。
配方文件可以简单理解为用作参数保存,可以换字为单位供界面控件或宏调用,对应RW,或RW_A类型寄存器。
配方文件制作好后,可下载到触摸屏里使用。
如果在本地模拟,可复制到软件安装目录供调用,目录如D:\Program Files\EBpro\HMI_memory\recipe;
常用汉字有3700左右,文件制作工作量过大,
自己制作闲麻烦的话,可下载附件后,直接使用里面我准备好的文件。

下载后的配方文件内包含常用汉字3750个,
已经按照拼音排序,我们只要在界面上设置字符输入元件的读取地址为配方寄存器,
再设置资料格式为UNICODE,元件就可显示汉字。
一个配方寄存器对应一个汉字,要显示什么汉字,设置对应配方寄存器地址就好。
2019-09-14_203032.jpg

1.创建窗口59作为我们要制作的键盘窗口,复制键盘窗口65的全部控件到窗口59直接使用。
2.再添加一个字符输入元件,读写地址设置RW-A0,长度3个字,
数值输入模式为LB0的位控制。添加一些美化界面的图片,效果如上图。

3.在图片上的数字 对应位置添加资料格式为Unicode的配方寄存器RW0-RW9,地址附加索引寄存器index0.
4.同样再添加位控制元件,读写地址LB1-LB9,都调用宏指令SelectChart,宏指令代码参考文末。
宏主要实现对应汉字选择功能。

5.添加资料格式为Unicode的配方寄存器RW3,长度10,用于显示与存在选择的汉字。
6.添加递增,递减的多状态设置元件,地址LW9200,递增减值8,最大最小值0,3749。
用于显示更多汉字。
7.添加多个位状态设置元件,地址LB0,开关类型设置为0N,标签图片都不使用,放置在每个字母上,
用于触发拼音发输入。
可置顶再设置字母按钮松开发出指令属性。
8.添加位状态设置元件,地址LB0,开关类型设置为0N,触发宏DecodePingYing,标签图片都不使用,放置于ENTER键上。
用于根据输入的拼音,显示出汉字。
9.位状态设置元件,地址LB0,开关类型设置为0N,触发宏Clear,标签图片都不使用,放置于Clear键上。
用于清空临时的全部内容。
10.添加功能键,属性设置为关闭窗口,标签图片都不使用,放置于空格键上,
再将空格键换成位状态切换开关,地址LB0,开关类型设置为OFF,
触发宏EndInput,标签图片都不使用,用于使用拼音输入结果。

例程仅供学习,更多功能,可在此例程基础上添加。
实际使用时在注意您项目与例程所用到的大量寄存器地址的冲突。
地址修改是建立在两个程序已经读懂的基础上,是个体力活,有需要折磨我的欢迎联系

至于我们编写好的窗口如何调用,
可以在任意界面添加字符输入元件,设置unicode,位控制,
再通过功能键打开拼音输入窗口使用。
操作过程中使用的4个宏可以在下面复制使用。
DecodePingYing
  1. macro_command main()

  2. short b0,b1,b2
  3. short temp1,temp2,temp3,temp4,temp5,temp6
  4. short Index_N=0

  5. short a[4]
  6. GetData(a[0], "Local HMI", RW_A, 0, 3)
  7.         
  8. b0=a[0]
  9. b1=a[1]
  10. b2=a[2]

  11. temp1=b0%256
  12. temp2=b0/256
  13. temp3=b1%256
  14. temp4=b1/256
  15. temp5=b2%256
  16. temp6=b2/256

  17. //----------------------------------------------------a
  18. if temp1==0x61  then                 //a
  19.   Index_N=0

  20.   if temp2==0x69 then                //ai
  21.     Index_N=2
  22.   end if

  23.   if temp2==0x6E then                //an
  24.     Index_N=15
  25.   
  26.      if temp3==0x67 then             //ang
  27.       Index_N=24
  28.    end if

  29.   end if

  30.   if temp2==0x6F then                //aO
  31.   Index_N=27
  32.   end if

  33. end if

  34. //----------------------------------------------------b
  35. if temp1==0x62  then                 //b
  36.   Index_N=36

  37.   if temp2==0x61 then                //ba
  38.     Index_N=36   
  39.     if temp3==0x69 then              //bai
  40.       Index_N=54
  41.     end if   
  42.     if temp3==0x6E then              //ban
  43.       Index_N=62      
  44.       if temp4==0x67 then            //bang
  45.         Index_N=77
  46.       end if
  47.     end if   
  48.     if temp3==0x6F then              //bao
  49.       Index_N=89
  50.     end if
  51.   end if
  52.   
  53.   if temp2==0x65 then                //be
  54.     Index_N=106   
  55.     if temp3==0x69 then              //bei
  56.       Index_N=106
  57.     end if
  58.     if temp3==0x6E then              //ben
  59.       Index_N=121      
  60.       if temp4==0x67 then            //beng
  61.         Index_N=125
  62.       end if
  63.     end if
  64.    end if
  65.    
  66.    if temp2==0x69 then                  //bi
  67.      Index_N=131     
  68.        if temp3==0x61 then              //bia
  69.          Index_N=155      
  70.          if temp4==0x6E then            //bian
  71.            Index_N=155
  72.          end if         
  73.          if temp4==0x6F then            //biao
  74.            Index_N=167
  75.          end if
  76.        end if        
  77.        if temp3==0x65 then              //bie
  78.          Index_N=171      
  79.        end if               
  80.        if temp3==0x6E then              //bin
  81.            Index_N=175      
  82.            if temp4==0x67 then          //bing
  83.              Index_N=181
  84.            end if
  85.        end if
  86.    end if
  87.    
  88.    if temp2==0x6F then                //bo
  89.      Index_N=190
  90.    end if
  91.    
  92.    if temp2==0x75 then                //bu
  93.      Index_N=209
  94.    end if
  95.       
  96. end if

  97. //----------------------------------------------------c
  98. if temp1=='c' then                    //c
  99.   Index_N=220

  100.   if temp2=='a' then                  //ca
  101.     Index_N=220   
  102.     if temp3=='i' then               //cai
  103.       Index_N=221      
  104.     end if      
  105.     if temp3=='n' then               //can
  106.       Index_N=232        
  107.       if temp4=='g' then             //cang
  108.         Index_N=239
  109.       end if         
  110.     end if     
  111.     if temp3=='o' then                //cao
  112.       Index_N=244
  113.     end if
  114. end if

  115.   if temp2=='e' then                 //ce
  116.     Index_N=249
  117.     if temp3=='n' then               //cen
  118.       Index_N=254
  119.       if temp4=='g' then             //ceng
  120.         Index_N=254
  121.       end if         
  122.     end if
  123.   end if
  124.    
  125.   if temp2=='h' then                 //ch
  126.     Index_N=256
  127.     if temp3=='a' then               //cha
  128.       Index_N=256  
  129.       if temp4=='i' then             //chai
  130.         Index_N=267
  131.       end if
  132.       if temp4=='n' then             //chan
  133.         Index_N=270
  134.         if temp5=='g' then           //chang
  135.           Index_N=280
  136.         end if
  137.       end if
  138.       if temp4=='o' then             //chao
  139.         Index_N=293
  140.       end if
  141.     end if   
  142.     if temp3=='e' then               //che
  143.       Index_N=302
  144.       if temp4=='n' then             //chen
  145.         Index_N=308
  146.         if temp5=='g' then           //cheng
  147.           Index_N=318
  148.         end if
  149.       end if
  150.     end if
  151.     if temp3=='i' then               //chi
  152.       Index_N=333
  153.     end if
  154.     if temp3=='o' then               //cho
  155.       Index_N=349
  156.       if temp4=='n' then             //chon
  157.         Index_N=349
  158.         if temp5=='g' then           //chong
  159.           Index_N=349
  160.         end if
  161.       end if
  162.       if temp4=='u' then             //chou
  163.         Index_N=354
  164.       end if
  165.     end if
  166.     if temp3=='u' then               //chu
  167.       Index_N=366
  168.       if temp4=='a' then             //chua
  169.         Index_N=382
  170.         if temp5=='i' then           //chuai
  171.           Index_N=382
  172.         end if
  173.         if temp5=='n' then           //chuan
  174.           Index_N=383
  175.           if temp6=='g' then         //chuang
  176.             Index_N=390
  177.           end if
  178.         end if
  179.       end if      
  180.       if temp4=='i' then             //chui
  181.         Index_N=396
  182.       end if      
  183.       if temp4=='n' then             //chun
  184.         Index_N=401
  185.       end if      
  186.       if temp4=='o' then             //chuo
  187.         Index_N=408
  188.       end if
  189.     end if
  190.   end if
  191.    
  192.   if temp2=='i' then                 //ci
  193.     Index_N=410
  194.   end if
  195.   
  196.   if temp2=='o' then                 //co
  197.     Index_N=422
  198.     if temp3=='n' then               //con
  199.       Index_N=422
  200.       if temp4=='g' then             //cong
  201.         Index_N=422
  202.       end if
  203.     end if  
  204.     if temp3=='u' then             //cou
  205.       Index_N=428
  206.     end if
  207.   end if
  208.   
  209.   if temp2=='u' then               //cu
  210.     Index_N=429
  211.     if temp3=='a' then             //cua
  212.       Index_N=433
  213.       if temp4=='n' then           //cuan
  214.         Index_N=433
  215.       end if
  216.     end if
  217.     if temp3=='i' then               //cui
  218.       Index_N=436
  219.     end if
  220.     if temp3=='n' then               //cnn
  221.       Index_N=444
  222.     end if
  223.     if temp3=='o' then               //cuo
  224.       Index_N=447
  225.     end if
  226.   end if
  227. end if

  228. //----------------------------------------------------d
  229. if temp1=='d' then                    //d
  230.   Index_N=453  
  231.   if temp2=='o' then                  //da
  232.     Index_N=453
  233.     if temp3=='i' then                //dai
  234.       Index_N=459
  235.     end if
  236.     if temp3=='n' then                //dan
  237.       Index_N=471
  238.       if temp4=='g' then             //dang
  239.         Index_N=486
  240.       end if
  241.     end if
  242.     if temp3=='o' then                //dao
  243.       Index_N=491
  244.     end if
  245.   end if
  246.    
  247.   if temp2=='e' then                  //de
  248.     Index_N=503
  249.     if temp3=='i' then                //dei
  250.       Index_N=504
  251.     end if
  252.     if temp3=='n' then                //den
  253.       Index_N=506
  254.       if temp4=='g' then              //deng
  255.         Index_N=506
  256.       end if
  257.     end if
  258.   end if
  259.    
  260.   if temp2=='i' then                  //di
  261.     Index_N=513
  262.     if temp3=='a' then                //dia
  263.       Index_N=532
  264.       if temp4=='n' then              //dian
  265.         Index_N=532
  266.       end if
  267.       if temp4=='o' then              //diao
  268.         Index_N=548
  269.       end if
  270.     end if
  271.     if temp3=='e' then                //die
  272.       Index_N=557
  273.     end if
  274.     if temp3=='n' then               //din
  275.       Index_N=564
  276.       if temp4=='g' then             //ding
  277.         Index_N=564
  278.       end if
  279.     end if
  280.     if temp3=='u' then               //diu
  281.       Index_N=573
  282.     end if   
  283.   end if  
  284.   
  285.   if temp2=='o' then                 //do
  286.     Index_N=574
  287.     if temp3=='n' then               //don
  288.       Index_N=574
  289.       if temp4=='g' then             //dong
  290.         Index_N=574
  291.       end if
  292.     end if
  293.     if temp3=='u' then               //dou
  294.       Index_N=584
  295.     end if
  296.   end if
  297.   
  298.   if temp2=='u' then                 //du
  299.     Index_N=591
  300.     if temp3=='a' then               //dua
  301.       Index_N=606
  302.       if temp4=='n' then             //duan
  303.         Index_N=606
  304.       end if
  305.     end if
  306.     if temp3=='i' then               //dui
  307.       Index_N=612
  308.     end if
  309.     if temp3=='n' then               //dun
  310.       Index_N=616
  311.     end if
  312.     if temp3=='o' then               //duo
  313.       Index_N=625
  314.     end if  
  315.   end if
  316. end if

  317. //----------------------------------------------------e
  318. if temp1=='e' then                   //e
  319.   Index_N=637
  320.   if temp2=='n' then                 //en
  321.     Index_N=650
  322.   end if
  323.   if temp2=='r' then                 //er
  324.     Index_N=651
  325.   end if
  326. end if

  327. //----------------------------------------------------f
  328. if temp1=='f' then                   //f
  329.   Index_N=659
  330.   if temp2=='a' then                 //fa
  331.     Index_N=659
  332.     if temp3=='n' then               //fan
  333.       Index_N=667
  334.       if temp4=='g' then             //fang
  335.         Index_N=684
  336.       end if
  337.     end if
  338.   end if

  339.   if temp2=='e' then                 //fe
  340.     Index_N=695
  341.     if temp3=='i' then               //fei
  342.       Index_N=695
  343.     end if
  344.     if temp3=='n' then               //fen
  345.       Index_N=707
  346.       if temp4=='g' then             //feng
  347.         Index_N=722
  348.       end if
  349.     end if  
  350.   end if

  351.   if temp2=='o' then                 //fo
  352.     Index_N=737
  353.     if temp3=='u' then               //fou
  354.       Index_N=738
  355.     end if
  356.   end if

  357.   if temp2=='u' then                 //fu
  358.     Index_N=739
  359.   end if
  360. end if

  361. //----------------------------------------------------g
  362. if temp1=='g' then                   //g
  363.   Index_N=784
  364.   
  365.   if temp2=='a' then                 //ga
  366.     Index_N=784
  367.     if temp3=='i' then               //gai
  368.       Index_N=785
  369.     end if
  370.     if temp3=='n' then               //gan
  371.       Index_N=791
  372.       if temp4=='g' then             //gang
  373.         Index_N=802
  374.       end if
  375.     end if
  376.     if temp3=='o' then               //gao
  377.       Index_N=811
  378.     end if
  379.   end if

  380.   if temp2=='e' then                 //ge
  381.     Index_N=821
  382.     if temp3=='i' then               //gei
  383.       Index_N=838
  384.     end if
  385.     if temp3=='n' then               //gen
  386.       Index_N=839
  387.       if temp4=='g' then             //geng
  388.         Index_N=841
  389.       end if
  390.     end if        
  391.   end if

  392.   if temp2=='o' then                 //go
  393.     Index_N=848
  394.     if temp3=='n' then               //gon
  395.       Index_N=848
  396.       if temp4=='g' then             //gong
  397.         Index_N=848
  398.       end if
  399.     end if        
  400.     if temp3=='u' then               //gou
  401.       Index_N=863
  402.     end if  
  403.   end if

  404.   if temp2=='u' then                 //gu
  405.     Index_N=872
  406.     if temp3=='a' then               //gua
  407.       Index_N=890
  408.       if temp4=='i' then             //guai
  409.         Index_N=896
  410.       end if
  411.       if temp4=='n' then             //guan
  412.         Index_N=899
  413.         if temp5=='g' then           //guang
  414.           Index_N=910
  415.         end if
  416.       end if
  417.     end if
  418.     if temp3=='i' then               //gui
  419.       Index_N=913
  420.     end if
  421.     if temp3=='n' then               //gun
  422.       Index_N=929
  423.     end if
  424.     if temp3=='o' then               //guo
  425.       Index_N=932
  426.     end if
  427.   end if
  428. end if

  429. //----------------------------------------------------h
  430. if temp1=='h' then                   //h
  431.   Index_N=938
  432.   
  433.   if temp2=='a' then                 //ha
  434.     Index_N=938
  435.     if temp3=='i' then               //hai
  436.       Index_N=939
  437.     end if
  438.     if temp3=='n' then               //han
  439.       Index_N=946
  440.       if temp4=='g' then             //hang
  441.         Index_N=965
  442.       end if
  443.     end if   
  444.     if temp3=='o' then               //hao
  445.       Index_N=968
  446.     end if      
  447.   end if
  448.   
  449.   if temp2=='e' then                 //he
  450.     Index_N=977
  451.     if temp3=='i' then               //hei
  452.       Index_N=995
  453.     end if
  454.     if temp3=='n' then               //hen
  455.       Index_N=997
  456.       if temp4=='g' then             //heng
  457.         Index_N=1001
  458.       end if
  459.     end if   
  460.   end if

  461.   if temp2=='o' then                 //ho
  462.     Index_N=1006
  463.     if temp3=='n' then               //hon
  464.       Index_N=1006
  465.       if temp4=='g' then             //hong
  466.         Index_N=1006
  467.       end if
  468.     end if   
  469.     if temp3=='u' then               //hou
  470.       Index_N=1015
  471.     end if   
  472.   end if

  473.   if temp2=='u' then                 //hu
  474.     Index_N=1022
  475.     if temp3=='a' then               //hua
  476.       Index_N=1040
  477.       if temp4=='i' then             //huai
  478.         Index_N=1049
  479.       end if
  480.       if temp4=='n' then             //huan
  481.         Index_N=1054
  482.         if temp5=='g' then           //huang
  483.           Index_N=1068
  484.         end if
  485.       end if
  486.     end if   
  487.     if temp3=='i' then               //hui
  488.       Index_N=1082
  489.     end if
  490.     if temp3=='n' then               //hun
  491.       Index_N=1103
  492.     end if
  493.     if temp3=='o' then               //huo
  494.       Index_N=1109
  495.     end if               
  496.   end if   
  497. end if
  498. //----------------------------------------------------j
  499. if temp1=='j' then                   //j
  500.   Index_N=1119
  501.   
  502.   if temp2=='i' then                 //ji
  503.     Index_N=1119
  504.     if temp3=='a' then               //jia
  505.       Index_N=1172
  506.       if temp4=='n' then             //jian
  507.         Index_N=1189
  508.         if temp5=='g' then           //jiang
  509.           Index_N=1229
  510.         end if        
  511.       end if
  512.       if temp4=='o' then             //jiao
  513.         Index_N=1242
  514.       end if      
  515.     end if
  516.     if temp3=='e' then               //jie
  517.       Index_N=1270
  518.     end if
  519.     if temp3=='n' then               //jin
  520.       Index_N=1297
  521.       if temp4=='g' then             //jing
  522.         Index_N=1317
  523.       end if      
  524.     end if
  525.     if temp3=='o' then               //jio
  526.       Index_N=1342
  527.       if temp4=='n' then             //jion
  528.         Index_N=1342
  529.         if temp5=='g' then           //jiong
  530.           Index_N=1342
  531.         end if        
  532.       end if      
  533.     end if      
  534.     if temp3=='u' then               //jiu
  535.       Index_N=1344
  536.     end if
  537.   end if
  538.   
  539.   if temp2=='u' then                 //ju
  540.     Index_N=1361
  541.     if temp3=='a' then               //jua
  542.       Index_N=1386
  543.       if temp4=='n' then             //juan
  544.         Index_N=1386
  545.       end if
  546.     end if
  547.     if temp3=='e' then               //jue
  548.       Index_N=1393
  549.     end if
  550.     if temp3=='n' then               //jun
  551.       Index_N=1403
  552.     end if           
  553.   end if   
  554. end if

  555. //----------------------------------------------------k
  556. if temp1=='k' then                   //k
  557.   Index_N=1414
  558.   if temp2=='a' then                 //ka
  559.     Index_N=1414
  560.     if temp3=='i' then               //kai
  561.       Index_N=1418
  562.     end if
  563.     if temp3=='n' then               //kan
  564.       Index_N=1423
  565.       if temp4=='g' then             //kang
  566.         Index_N=1429
  567.       end if  
  568.     end if   
  569.     if temp3=='o' then               //kao
  570.       Index_N=1436
  571.     end if            
  572.   end if
  573.   
  574.   if temp2=='e' then                 //ke
  575.     Index_N=1440
  576.     if temp3=='n' then               //ken
  577.       Index_N=1455
  578.       if temp4=='g' then             //keng
  579.         Index_N=1459
  580.       end if
  581.     end if
  582.   end if
  583.   
  584.   if temp2=='o' then                 //ko
  585.     Index_N=1461
  586.     if temp3=='n' then               //kon
  587.       Index_N=1461
  588.       if temp4=='g' then             //kong
  589.         Index_N=1461
  590.       end if
  591.     end if
  592.     if temp3=='u' then               //kou
  593.       Index_N=1465
  594.     end if   
  595.   end if
  596.    
  597.   if temp2=='u' then                 //ku
  598.     Index_N=1469
  599.     if temp3=='a' then               //kua
  600.       Index_N=1476
  601.       if temp4=='i' then             //kuai
  602.         Index_N=1481
  603.       end if
  604.       if temp4=='n' then             //kuan
  605.         Index_N=1485
  606.         if temp5=='g' then           //kuang
  607.           Index_N=1487
  608.         end if        
  609.       end if      
  610.     end if
  611.     if temp3=='i' then               //kui
  612.       Index_N=1495
  613.     end if
  614.     if temp3=='n' then               //kun
  615.       Index_N=1506
  616.     end if
  617.     if temp3=='o' then               //kuo
  618.       Index_N=1510
  619.     end if
  620.   end if   
  621. end if

  622. //----------------------------------------------------l
  623. if temp1=='l' then                   //l
  624.   Index_N=1514
  625.   
  626.   if temp2=='a' then                 //la
  627.     Index_N=1514
  628.     if temp3=='i' then               //lai
  629.       Index_N=1521
  630.     end if
  631.     if temp3=='n' then               //lan
  632.       Index_N=1524
  633.       if temp4=='g' then             //lang
  634.         Index_N=1539
  635.       end if      
  636.     end if   
  637.     if temp3=='o' then               //lao
  638.       Index_N=1546
  639.     end if     
  640.   end if
  641.   
  642.   if temp2=='e' then                 //le
  643.     Index_N=1555
  644.     if temp3=='i' then               //lei
  645.       Index_N=1557
  646.     end if
  647.     if temp3=='n' then               //len
  648.       Index_N=1568
  649.       if temp4=='g' then             //leng
  650.         Index_N=1568
  651.       end if     
  652.     end if      
  653.   end if
  654.   
  655.   if temp2=='i' then                 //li
  656.     Index_N=1571
  657.     if temp3=='a' then               //lia
  658.       Index_N=1605
  659.       if temp4=='n' then             //lian
  660.         Index_N=1606
  661.         if temp5=='g' then           //liang
  662.           Index_N=1620
  663.         end if     
  664.       end if     
  665.       if temp4=='o' then             //liao
  666.         Index_N=1631
  667.       end if   
  668.     end if      
  669.     if temp3=='e' then               //lie
  670.       Index_N=1644
  671.     end if
  672.     if temp3=='n' then               //lin
  673.       Index_N=1649
  674.       if temp4=='g' then             //ling
  675.         Index_N=1661
  676.       end if   
  677.     end if   
  678.     if temp3=='u' then               //liu
  679.       Index_N=1675
  680.     end if  
  681.   end if
  682.   
  683.   if temp2=='o' then                 //lo
  684.     Index_N=1686
  685.     if temp3=='n' then               //lon
  686.       Index_N=1686
  687.       if temp4=='g' then             //long
  688.         Index_N=1686
  689.       end if
  690.     end if
  691.     if temp3=='u' then               //lou
  692.       Index_N=1695
  693.     end if   
  694.   end if
  695.    
  696.   if temp2=='u' then                 //lu
  697.     Index_N=1701
  698.     if temp3=='a' then               //lua
  699.       Index_N=1735
  700.       if temp4=='n' then             //luan
  701.         Index_N=1735
  702.       end if
  703.     end if
  704.     if temp3=='n' then               //lun
  705.       Index_N=1743
  706.     end if   
  707.     if temp3=='o' then               //luo
  708.       Index_N=1750
  709.     end if        
  710.   end if   
  711.   
  712.   if temp2=='v' then                 //lv
  713.     Index_N=1721
  714.     if temp3=='e' then               //lve
  715.       Index_N=1741
  716.     end if
  717.   end if   
  718. end if

  719. //----------------------------------------------------m
  720. if temp1=='m' then                   //m
  721.   Index_N=1762
  722.   if temp2=='a' then                 //ma
  723.     Index_N=1762
  724.     if temp3=='i' then               //mai
  725.       Index_N=1770
  726.     end if
  727.     if temp3=='n' then               //man
  728.       Index_N=1776
  729.       if temp4=='g' then             //mang
  730.         Index_N=1785
  731.       end if      
  732.     end if   
  733.     if temp3=='o' then               //mao
  734.       Index_N=1791
  735.     end if   
  736.   end if
  737.   
  738.   if temp2=='e' then                 //me
  739.     Index_N=1803
  740.     if temp3=='i' then               //mei
  741.       Index_N=1804
  742.     end if   
  743.     if temp3=='n' then               //men
  744.       Index_N=1820
  745.       if temp4=='g' then             //meng
  746.         Index_N=1823
  747.       end if     
  748.     end if      
  749.   end if
  750.   
  751.   if temp2=='i' then                 //mi
  752.     Index_N=1831
  753.     if temp3=='a' then               //mia
  754.       Index_N=1845
  755.       if temp4=='n' then             //mian
  756.         Index_N=1845
  757.       end if
  758.       if temp4=='o' then             //miao
  759.         Index_N=1854
  760.       end if      
  761.     end if
  762.     if temp3=='e' then               //mie
  763.       Index_N=1862
  764.     end if
  765.     if temp3=='n' then               //min
  766.       Index_N=1864
  767.       if temp4=='g' then             //ming
  768.         Index_N=1870
  769.       end if      
  770.     end if     
  771.     if temp3=='u' then               //miu
  772.       Index_N=1876
  773.     end if      
  774.   end if
  775.   
  776.   if temp2=='o' then                 //mo
  777.     Index_N=1877
  778.     if temp3=='u' then               //mou
  779.       Index_N=1894
  780.     end if   
  781.   end if
  782.   
  783.   if temp2=='u' then                 //mu
  784.     Index_N=1898
  785.   end if
  786. end if

  787. //----------------------------------------------------n
  788. if temp1=='n' then                   //n
  789.   Index_N=1912
  790.   
  791.   if temp2=='a' then                 //na
  792.     Index_N=1912
  793.     if temp3=='i' then               //nai
  794.       Index_N=1919
  795.     end if
  796.     if temp3=='n' then               //nan
  797.       Index_N=1924
  798.       if temp4=='g' then             //nang
  799.         Index_N=1927
  800.       end if
  801.     end if   
  802.     if temp3=='o' then               //nao
  803.       Index_N=1928
  804.     end if     
  805.   end if
  806.   
  807.   if temp2=='e' then                 //ne
  808.     Index_N=1933
  809.     if temp3=='i' then               //nei
  810.       Index_N=1934
  811.     end if
  812.     if temp3=='n' then               //nen
  813.       Index_N=1936
  814.       if temp4=='g' then             //neng
  815.         Index_N=1937
  816.       end if
  817.     end if      
  818.   end if
  819.   
  820.   if temp2=='i' then                 //ni
  821.     Index_N=1938
  822.     if temp3=='a' then               //nia
  823.       Index_N=1949
  824.       if temp4=='n' then             //nian
  825.         Index_N=1949
  826.         if temp5=='g' then           //niang
  827.           Index_N=1956
  828.         end if        
  829.       end if
  830.       if temp4=='o' then             //niao
  831.         Index_N=1958     
  832.       end if     
  833.     end if      
  834.     if temp3=='e' then               //nie
  835.       Index_N=1960
  836.     end if
  837.     if temp3=='n' then               //nin
  838.       Index_N=1967
  839.       if temp4=='g' then             //ning
  840.         Index_N=1968
  841.       end if      
  842.     end if   
  843.     if temp3=='u' then               //niu
  844.       Index_N=1974
  845.     end if  
  846.   end if  
  847.   
  848.   if temp2=='o' then                 //no
  849.     Index_N=1978
  850.     if temp3=='n' then               //non
  851.       Index_N=1978
  852.       if temp4=='g' then             //nong
  853.         Index_N=1978
  854.       end if
  855.     end if
  856.   end if
  857.   
  858.   if temp2=='u' then                 //nu
  859.     Index_N=1982
  860.     if temp3=='a' then               //nua
  861.       Index_N=1986
  862.       if temp4=='n' then             //nuan
  863.         Index_N=1986
  864.       end if
  865.     end if
  866.     if temp3=='o' then               //nuo
  867.       Index_N=1989
  868.     end if  
  869.   end if
  870.    
  871.   if temp2=='v' then                 //nv
  872.     Index_N=1985
  873.     if temp3=='e' then               //nve
  874.       Index_N=1987
  875.     end if  
  876.   end if      
  877. end if

  878. //----------------------------------------------------o
  879. if temp1==0x6F  then              //o
  880.   Index_N=1993
  881.   if temp2==0x75 then             //ou
  882.     Index_N=1994
  883.   end if
  884. end if

  885. //----------------------------------------------------p
  886. if temp1=='p' then                   //p
  887.   Index_N=2001
  888.   if temp2=='a' then                 //pa
  889.     Index_N=2001
  890.     if temp3=='i' then               //pai
  891.       Index_N=2007
  892.     end if
  893.     if temp3=='n' then               //pan
  894.       Index_N=2013
  895.       if temp4=='g' then             //pang
  896.         Index_N=2021
  897.       end if
  898.     end if   
  899.     if temp3=='o' then               //pao
  900.       Index_N=2026
  901.     end if  
  902.   end if

  903.   if temp2=='e' then                 //pe
  904.     Index_N=2033
  905.     if temp3=='i' then               //pei
  906.       Index_N=2033
  907.     end if
  908.     if temp3=='n' then               //pen
  909.       Index_N=2042
  910.       if temp4=='g' then             //peng
  911.         Index_N=2044
  912.       end if      
  913.     end if   
  914.   end if
  915.   
  916.   if temp2=='i' then                 //pi
  917.     Index_N=2058
  918.     if temp3=='a' then               //pia
  919.       Index_N=2075
  920.       if temp4=='n' then             //pian
  921.         Index_N=2075
  922.       end if
  923.       if temp4=='o' then             //piao
  924.         Index_N=2079
  925.       end if      
  926.     end if
  927.     if temp3=='e' then               //pie
  928.       Index_N=2083
  929.     end if
  930.     if temp3=='n' then               //pin
  931.       Index_N=2085
  932.       if temp4=='g' then             //ping
  933.         Index_N=2090
  934.       end if
  935.     end if            
  936.   end if

  937.   if temp2=='o' then                 //po
  938.     Index_N=2099
  939.     if temp3=='u' then               //pou
  940.       Index_N=2107
  941.     end if
  942.   end if

  943.   if temp2=='u' then                 //pu
  944.     Index_N=2108
  945.   end if   
  946. end if   

  947. //----------------------------------------------------q
  948. if temp1=='q' then                   //q
  949.   Index_N=2123
  950.   if temp2=='i' then                 //qi
  951.     Index_N=2123
  952.     if temp3=='a' then               //qia
  953.       Index_N=2159
  954.       if temp4=='n' then             //qian
  955.         Index_N=2162
  956.         if temp5=='g' then           //qiang
  957.           Index_N=2184
  958.         end if        
  959.       end if
  960.       if temp4=='o' then             //qiao
  961.         Index_N=2192
  962.       end if  
  963.     end if
  964.     if temp3=='e' then               //qie
  965.       Index_N=2207
  966.     end if
  967.     if temp3=='n' then               //qin
  968.       Index_N=2212
  969.       if temp4=='g' then             //qing
  970.         Index_N=2223
  971.       end if      
  972.     end if
  973.     if temp3=='o' then               //qio
  974.       Index_N=2236
  975.       if temp4=='n' then             //qion
  976.         Index_N=2236
  977.         if temp5=='g' then           //qiong
  978.           Index_N=2236
  979.         end if        
  980.       end if      
  981.     end if
  982.     if temp3=='u' then               //qiu
  983.       Index_N=2238
  984.     end if         
  985.   end if
  986.   
  987.   if temp2=='u' then                 //qu
  988.     Index_N=2246
  989.     if temp3=='a' then               //qua
  990.       Index_N=2259
  991.       if temp4=='n' then             //quan
  992.         Index_N=2259
  993.       end if
  994.     end if
  995.     if temp3=='e' then               //que
  996.       Index_N=2270
  997.     end if
  998.     if temp3=='n' then               //qun
  999.       Index_N=2278
  1000.     end if  
  1001.   end if   
  1002. end if

  1003. //----------------------------------------------------r
  1004. if temp1=='r' then                   //r
  1005.   Index_N=2280
  1006.   if temp2=='a' then                 //ra
  1007.     Index_N=2280
  1008.     if temp3=='n' then               //ran
  1009.       Index_N=2280
  1010.       if temp4=='g' then             //rang
  1011.         Index_N=2284
  1012.       end if
  1013.     end if
  1014.     if temp3=='o' then               //rao
  1015.       Index_N=2289
  1016.     end if  
  1017.   end if
  1018.   
  1019.   if temp2=='e' then                 //re
  1020.     Index_N=2292
  1021.     if temp3=='n' then               //ren
  1022.       Index_N=2294
  1023.       if temp4=='g' then             //reng
  1024.         Index_N=2304
  1025.       end if
  1026.     end if
  1027.   end if
  1028.   
  1029.   if temp2=='i' then                 //ri
  1030.     Index_N=2306
  1031.   end if
  1032.   
  1033.   if temp2=='o' then                 //ro
  1034.     Index_N=2307
  1035.     if temp3=='n' then               //ron
  1036.       Index_N=2307
  1037.       if temp4=='g' then             //rong
  1038.         Index_N=2307
  1039.       end if
  1040.     end if
  1041.     if temp3=='u' then               //rou
  1042.       Index_N=2317
  1043.     end if  
  1044.   end if
  1045.   
  1046.   if temp2=='u' then                 //ru
  1047.     Index_N=2320
  1048.     if temp3=='a' then               //rua
  1049.       Index_N=2330
  1050.       if temp4=='n' then             //ruan
  1051.         Index_N=2330
  1052.       end if
  1053.     end if  
  1054.     if temp3=='i' then               //rui
  1055.       Index_N=2332
  1056.     end if
  1057.     if temp3=='n' then               //run
  1058.       Index_N=2335
  1059.     end if
  1060.     if temp3=='o' then               //ruo
  1061.       Index_N=2337
  1062.     end if  
  1063.   end if  
  1064. end if

  1065. //----------------------------------------------------s
  1066. if temp1=='s' then                   //s
  1067.   Index_N=2339
  1068.   if temp2=='a' then                 //sa
  1069.     Index_N=2339
  1070.     if temp3=='i' then               //sai
  1071.       Index_N=2342
  1072.     end if
  1073.     if temp3=='n' then               //san
  1074.       Index_N=2346
  1075.       if temp4=='g' then             //sang
  1076.         Index_N=2350
  1077.       end if
  1078.     end if   
  1079.     if temp3=='o' then               //sao
  1080.       Index_N=2353
  1081.     end if     
  1082.   end if
  1083.   
  1084.   if temp2=='e' then                 //se
  1085.     Index_N=2357
  1086.     if temp3=='n' then               //sen
  1087.       Index_N=2360
  1088.       if temp4=='g' then             //seng
  1089.         Index_N=2361
  1090.       end if
  1091.     end if
  1092.   end if
  1093.   
  1094.   if temp2=='h' then                 //sh
  1095.     Index_N=2362
  1096.     if temp3=='a' then               //sha
  1097.       Index_N=2362
  1098.       if temp4=='i' then             //shai
  1099.         Index_N=2371
  1100.       end if
  1101.       if temp4=='n' then             //shan
  1102.         Index_N=2373
  1103.         if temp5=='g' then           //shang
  1104.           Index_N=2389
  1105.         end if        
  1106.       end if   
  1107.       if temp4=='o' then             //shao
  1108.         Index_N=2397
  1109.       end if   
  1110.     end if
  1111.     if temp3=='e' then               //she
  1112.       Index_N=2408
  1113.       if temp4=='n' then             //shen
  1114.         Index_N=2420
  1115.         if temp5=='g' then           //sheng
  1116.           Index_N=2436
  1117.         end if        
  1118.       end if         
  1119.     end if   
  1120.     if temp3=='i' then               //shi
  1121.       Index_N=2447
  1122.     end if  
  1123.     if temp3=='o' then               //sho
  1124.       Index_N=2494
  1125.       if temp4=='u' then             //shou
  1126.         Index_N=2494      
  1127.       end if         
  1128.     end if        
  1129.     if temp3=='u' then               //shu
  1130.       Index_N=2504
  1131.       if temp4=='a' then             //shua
  1132.         Index_N=2537
  1133.         if temp5=='i' then           //shuai
  1134.           Index_N=2539
  1135.         end if
  1136.         if temp5=='n' then           //shuan
  1137.           Index_N=2543
  1138.           if temp6=='g' then         //shuang
  1139.             Index_N=2545
  1140.           end if   
  1141.         end if                     
  1142.       end if         
  1143.       if temp4=='i' then             //shui
  1144.         Index_N=2548
  1145.       end if
  1146.       if temp4=='n' then             //shun
  1147.         Index_N=2552
  1148.       end if
  1149.       if temp4=='o' then             //shuo
  1150.         Index_N=2556
  1151.       end if     
  1152.     end if      
  1153.   end if
  1154.   
  1155.   if temp2=='i' then                 //si
  1156.     Index_N=2560
  1157.   end if
  1158.   
  1159.   if temp2=='o' then                 //so
  1160.     Index_N=2576
  1161.     if temp3=='n' then               //son
  1162.       Index_N=2576
  1163.       if temp4=='g' then             //song
  1164.         Index_N=2576
  1165.       end if
  1166.     end if
  1167.     if temp3=='u' then               //sou
  1168.       Index_N=2584
  1169.     end if   
  1170.   end if
  1171.   
  1172.   if temp2=='u' then                 //su
  1173.     Index_N=2588
  1174.     if temp3=='a' then               //sua
  1175.       Index_N=2600
  1176.       if temp4=='n' then             //suan
  1177.         Index_N=2600
  1178.       end if
  1179.     end if
  1180.     if temp3=='i' then               //sui
  1181.       Index_N=2603
  1182.     end if  
  1183.     if temp3=='n' then               //sun
  1184.       Index_N=2614
  1185.     end if  
  1186.     if temp3=='o' then               //suo
  1187.       Index_N=2617
  1188.     end if  
  1189.   end if     
  1190. end if

  1191. //----------------------------------------------------t
  1192. if temp1=='t' then                   //t
  1193.   Index_N=2625
  1194.   if temp2=='a' then                 //ta
  1195.     Index_N=2625
  1196.     if temp3=='i' then               //tai
  1197.       Index_N=2633
  1198.     end if
  1199.     if temp3=='n' then               //tan0
  1200.       Index_N=2642
  1201.       if temp4=='g' then             //tang
  1202.         Index_N=2660
  1203.       end if
  1204.     end if   
  1205.     if temp3=='o' then               //tao
  1206.       Index_N=2673
  1207.     end if   
  1208.   end if
  1209.   
  1210.   if temp2=='e' then                 //te
  1211.     Index_N=2684
  1212.     if temp3=='n' then               //ten
  1213.       Index_N=2685
  1214.       if temp4=='g' then             //teng
  1215.         Index_N=2685
  1216.       end if
  1217.     end if
  1218.   end if
  1219.   
  1220.   if temp2=='i' then                 //ti
  1221.     Index_N=2689
  1222.     if temp3=='a' then               //tia
  1223.       Index_N=2704
  1224.       if temp4=='n' then             //tian
  1225.         Index_N=2704
  1226.       end if
  1227.       if temp4=='o' then             //tiao
  1228.         Index_N=2712
  1229.       end if      
  1230.     end if
  1231.     if temp3=='e' then               //tie
  1232.       Index_N=2717   
  1233.     end if  
  1234.     if temp3=='n' then               //tin
  1235.       Index_N=2720
  1236.       if temp4=='g' then             //ting
  1237.         Index_N=2720
  1238.       end if
  1239.     end if
  1240.   end if   
  1241.   
  1242.   if temp2=='o' then                 //to
  1243.     Index_N=2730
  1244.     if temp3=='n' then               //ton
  1245.       Index_N=2730
  1246.       if temp4=='g' then             //tong
  1247.         Index_N=2730
  1248.       end if
  1249.     end if
  1250.     if temp3=='u' then               //you
  1251.       Index_N=2743
  1252.     end if  
  1253.   end if

  1254.   if temp2=='u' then                 //tu
  1255.     Index_N=2747
  1256.     if temp3=='a' then               //tua
  1257.       Index_N=2758
  1258.       if temp4=='n' then             //tuan
  1259.         Index_N=2758
  1260.       end if
  1261.     end if
  1262.     if temp3=='i' then               //tui
  1263.       Index_N=2760
  1264.     end if
  1265.     if temp3=='n' then               //tun
  1266.       Index_N=2766
  1267.     end if
  1268.     if temp3=='o' then               //tuo
  1269.       Index_N=2769
  1270.     end if  
  1271.   end if  
  1272. end if

  1273. //----------------------------------------------------w
  1274. if temp1=='w' then                   //w
  1275.   Index_N=2780
  1276.   if temp2=='a' then                 //wa
  1277.     Index_N=2780
  1278.     if temp3=='i' then               //wai
  1279.       Index_N=2787
  1280.     end if
  1281.     if temp3=='n' then               //wan
  1282.       Index_N=2789
  1283.       if temp4=='g' then             //wang
  1284.         Index_N=2806
  1285.       end if      
  1286.     end if      
  1287.   end if
  1288.   
  1289.   if temp2=='e' then                 //we
  1290.     Index_N=2816
  1291.     if temp3=='i' then               //wei
  1292.       Index_N=2816
  1293.     end if
  1294.     if temp3=='n' then               //wen
  1295.       Index_N=2849
  1296.       if temp4=='g' then             //weng
  1297.         Index_N=2859
  1298.       end if
  1299.     end if
  1300.   end if

  1301.   if temp2=='o' then                 //wo
  1302.     Index_N=2862
  1303.   end if
  1304.   if temp2=='u' then                 //wu
  1305.     Index_N=2871
  1306.   end if   
  1307. end if

  1308. //----------------------------------------------------x
  1309. if temp1=='x' then                   //x
  1310.   Index_N=2900
  1311.   if temp2=='i' then                 //xi
  1312.     Index_N=2900
  1313.     if temp3=='a' then               //xia
  1314.       Index_N=2935
  1315.       if temp4=='n' then             //xian
  1316.         Index_N=2948
  1317.         if temp5=='g' then           //xiang
  1318.           Index_N=2974
  1319.         end if        
  1320.       end if
  1321.       if temp4=='o' then             //xiao
  1322.         Index_N=2994
  1323.       end if   
  1324.     end if
  1325.     if temp3=='e' then               //xie
  1326.       Index_N=3012
  1327.     end if
  1328.     if temp3=='n' then               //xin
  1329.       Index_N=3033
  1330.       if temp4=='g' then             //xing
  1331.         Index_N=3043
  1332.       end if   
  1333.     end if  
  1334.     if temp3=='o' then               //xio
  1335.       Index_N=3058
  1336.       if temp4=='n' then             //xion
  1337.         Index_N=3058
  1338.         if temp5=='g' then           //xiong
  1339.           Index_N=3058
  1340.         end if   
  1341.       end if
  1342.     end if
  1343.     if temp3=='u' then               //xiu
  1344.       Index_N=3065
  1345.     end if  
  1346.   end if
  1347.   
  1348.   if temp2=='u' then                 //xu
  1349.     Index_N=3074
  1350.     if temp3=='a' then               //xua
  1351.       Index_N=3093
  1352.       if temp4=='n' then             //xuan
  1353.         Index_N=3093
  1354.       end if
  1355.     end if
  1356.     if temp3=='e' then               //xue
  1357.       Index_N=3103
  1358.     end if
  1359.     if temp3=='n' then               //xun
  1360.       Index_N=3109
  1361.     end if  
  1362.   end if  
  1363. end if

  1364. //----------------------------------------------------y
  1365. if temp1=='y' then                   //y
  1366.   Index_N=3123
  1367.   if temp2=='a' then                 //ya
  1368.     Index_N=3123
  1369.     if temp3=='n' then               //yan
  1370.       Index_N=3139
  1371.       if temp4=='g' then             //yang
  1372.         Index_N=3172
  1373.       end if
  1374.     end if
  1375.     if temp3=='o' then               //yao
  1376.       Index_N=3189
  1377.     end if
  1378.   end if
  1379.   
  1380.   if temp2=='e' then                 //ye
  1381.     Index_N=3204
  1382.   end if
  1383.   
  1384.   if temp2=='i' then                 //yi
  1385.     Index_N=3219
  1386.     if temp3=='n' then               //yin
  1387.       Index_N=3272
  1388.       if temp4=='g' then             //ying
  1389.         Index_N=3288
  1390.       end if
  1391.     end if   
  1392.   end if
  1393.   
  1394.   if temp2=='o' then                 //yo
  1395.     Index_N=3306
  1396.     if temp3=='n' then               //yon
  1397.       Index_N=3307
  1398.       if temp4=='g' then             //yong
  1399.         Index_N=3307
  1400.       end if
  1401.     end if
  1402.     if temp3=='u' then               //you
  1403.       Index_N=3322
  1404.     end if
  1405.   end if
  1406.    
  1407.   if temp2=='u' then                 //yu
  1408.     Index_N=3342
  1409.     if temp3=='a' then               //yua
  1410.       Index_N=3387
  1411.       if temp4=='n' then             //yuan
  1412.         Index_N=3387
  1413.       end if
  1414.     end if
  1415.     if temp3=='e' then               //yue
  1416.       Index_N=3407
  1417.     end if
  1418.     if temp3=='n' then               //yun
  1419.       Index_N=3417
  1420.     end if      
  1421.   end if  
  1422. end if

  1423. //----------------------------------------------------z
  1424. if temp1=='z' then                   //z
  1425.   Index_N=3429
  1426.   if temp2=='a' then                 //za
  1427.     Index_N=3429
  1428.     if temp3=='i' then               //zai
  1429.       Index_N=3431
  1430.     end if
  1431.     if temp3=='n' then               //zan
  1432.       Index_N=3438
  1433.       if temp4=='g' then             //zang
  1434.         Index_N=3442
  1435.       end if
  1436.     end if  
  1437.     if temp3=='o' then               //zao
  1438.       Index_N=3445
  1439.     end if
  1440.   end if
  1441.   
  1442.   if temp2=='e' then                 //ze
  1443.     Index_N=3459
  1444.     if temp3=='i' then               //zei
  1445.       Index_N=3463
  1446.     end if
  1447.     if temp3=='n' then               //zen
  1448.       Index_N=3464
  1449.       if temp4=='g' then             //zeng
  1450.         Index_N=3465
  1451.       end if
  1452.     end if      
  1453.   end if

  1454.   if temp2=='h' then                 //zh
  1455.     Index_N=3469
  1456.     if temp3=='a' then               //zha
  1457.       Index_N=3469
  1458.       if temp4=='i' then             //zhai
  1459.         Index_N=3483
  1460.       end if
  1461.       if temp4=='n' then             //zhan
  1462.         Index_N=3489
  1463.         if temp5=='g' then           //zhang
  1464.           Index_N=3506
  1465.         end if        
  1466.       end if      
  1467.       if temp4=='o' then             //zhao
  1468.         Index_N=3521
  1469.       end if   
  1470.     end if
  1471.     if temp3=='e' then               //zhe
  1472.       Index_N=3531
  1473.       if temp4=='n' then             //zhen
  1474.         Index_N=3541
  1475.         if temp5=='g' then           //zheng
  1476.           Index_N=3557
  1477.         end if
  1478.       end if
  1479.     end if
  1480.     if temp3=='i' then               //zhi
  1481.       Index_N=3572
  1482.     end if
  1483.     if temp3=='o' then               //zho
  1484.       Index_N=3615
  1485.       if temp4=='n' then             //zhon
  1486.         Index_N=3615
  1487.         if temp5=='g' then           //zhong
  1488.           Index_N=3615
  1489.         end if
  1490.       end if
  1491.       if temp4=='u' then             //zhou
  1492.         Index_N=3626
  1493.       end if  
  1494.     end if
  1495.     if temp3=='u' then               //zhu
  1496.       Index_N=3640
  1497.       if temp4=='a' then             //zhua
  1498.         Index_N=3666
  1499.         if temp5=='i' then           //zhuai
  1500.           Index_N=3668
  1501.         end if
  1502.         if temp5=='n' then           //zhuan
  1503.           Index_N=3669
  1504.           if temp6=='g' then         //zhuang
  1505.             Index_N=3675
  1506.           end if
  1507.         end if        
  1508.       end if
  1509.       if temp4=='i' then             //zhui
  1510.         Index_N=3682
  1511.       end if
  1512.       if temp4=='n' then             //zhun
  1513.         Index_N=3688
  1514.       end if
  1515.       if temp4=='o' then             //zhuo
  1516.         Index_N=3690
  1517.       end if   
  1518.     end if
  1519.   end if
  1520.   
  1521.   if temp2=='i' then                 //zi
  1522.     Index_N=3701
  1523.   end if
  1524.   
  1525.   if temp2=='o' then                 //zo
  1526.     Index_N=3716
  1527.     if temp3=='n' then               //zon
  1528.       Index_N=3716
  1529.       if temp4=='g' then             //zong
  1530.         Index_N=3716
  1531.       end if
  1532.     end if
  1533.     if temp3=='u' then               //zou
  1534.       Index_N=3723
  1535.     end if  
  1536.   end if
  1537.   
  1538.   if temp2=='u' then                 //zu
  1539.     Index_N=3727
  1540.     if temp3=='a' then               //zua
  1541.       Index_N=3735
  1542.       if temp4=='n' then             //zuan
  1543.         Index_N=3735
  1544.       end if
  1545.     end if
  1546.     if temp3=='i' then               //zui
  1547.       Index_N=3737
  1548.     end if
  1549.     if temp3=='n' then               //zun
  1550.       Index_N=3741
  1551.     end if
  1552.     if temp3=='o' then               //zuo
  1553.       Index_N=3743
  1554.     end if  
  1555.   end if
  1556. end if

  1557. //----------------------------------------------------
  1558. SetData(Index_N, "Local HMI", LW, 9200, 1)
  1559. end macro_command
复制代码
SeelctChart

  1. macro_command main()
  2. short a[10],b[10],d[10]={0,0,0,0,0,0,0,0,0,0}
  3. bool c[9]
  4. short index0,i
  5. //获取选择的字符
  6. GetData(c[0], "Local HMI", LB, 1, 9)
  7. GetData(index0, "Local HMI", LW, 9200, 1)
  8. GetData(a[0], "Local HMI", RW, index0, 10)

  9. for i=0 to 9 step 1
  10. if c[i] == true then
  11. index0 = i
  12. break
  13. end if
  14. next

  15. //累加选择的字符
  16. short num=0//最多10字符
  17. GetData(num, "Local HMI", RW_A, 13, 1)
  18. if(num >=10)then
  19. num=0
  20. SetData(d[0], "Local HMI", RW_A, 3, 10)
  21. end if
  22. GetData(b[0], "Local HMI", RW_A, 3, 10)
  23. b[num] = a[index0]
  24. SetData(b[0], "Local HMI", RW_A, 3, 10)
  25. num = num+1
  26. SetData(num, "Local HMI", RW_A, 13, 1)
  27. //按钮复位
  28. SetData(d[0], "Local HMI", LB, 1, 9)
  29. end macro_command
复制代码
Clear
  1. macro_command main()
  2. short d[15]
  3. FILL(d[0],0,15)
  4. SetData(d[0], "Local HMI", RW_A, 0, 14)
  5. SetData(d[0], "Local HMI", LB, 0, 9)
  6. end macro_command
复制代码
EndInput

  1. macro_command main()
  2. short d[10]
  3. GetData(d[0], "Local HMI", RW_A, 3, 10)
  4. SetData(d[0], "Local HMI", LW, 0, 10)

  5. end macro_command
复制代码








回复

使用道具 举报

大神点评(9)

qq263946146 楼主 2020-10-20 16:29:35 显示全部楼层
这里提醒一下,例程下载后,配方文件准备好是可以直接离线模拟运行,查看效果的。
很多网友下载后都是自己实现,今天出现一位网友,说自己实在不会,花了点红包让我远程帮忙。
发现我自己也解决不了,该想到的都排查了。
由于研究破解过编程软件,以及设备项目上也长期使用编程软件,发现其BUG多,缺陷也多,
本着对威纶编程软件开发工程师的鄙视,怀疑可能又是不同编程软件版本问题。
程序是我用V6.04.1版本编写的,经本人在虚拟机上测试,此版本能正常使用。
但使用网友的最新版本,真的什么都不显示。

:L:L:L:L:L:L:L:L:L:L:L:L:L:L:L

可能又是新版本的GUB吧,控件肯定又做了更新,没有向下兼容,显示不出UNICODE格式内容。
猜想而已,编程软件版本太多了,也没一一去测试.
具体请用编程软件解压缩文件EBProject1.ecmp后,双击打开工程文件,
如果版本不匹配,编程软件会弹出提示框;

此例程工程文件我在WIN10 64位系统模拟运行过,也下载到TK6071IP屏使用过,一切正常。
使用V6.04.1版本.

在此记录下网友反馈的问题与解决方法。



回复

使用道具 举报

qq263946146 发表于 2020-10-20 16:29
这里提醒一下,例程下载后,配方文件准备好是可以直接离线模拟运行,查看效果的。
很多网友下载后都是自己 ...

官方威纶的编程软件一天一更新的,
感觉都没有个统一测试,发布的很随意。
都没敢去下载当小白鼠。
我有遇到过打开老版本的程序,排程控件控件不显示时间的。
控件的每个属性全部看一遍再应用下就好了。

没需要还是用原先的版本好。
回复

使用道具 举报

qq263946146 楼主 2021-2-14 10:44:28 显示全部楼层
工控终极高手 发表于 2021-2-14 10:41
官方威纶的编程软件一天一更新的,
感觉都没有个统一测试,发布的很随意。
都没敢去下载当小白鼠。

也是。

它有发布是日期,你看日期是很久的再下载用吧。
它发布很久了,说明市场很长时间没有反馈问题。
新版本还是有些功能更新的。
比如宏,
宏代码变量会提示初始化,
宏名称也会提示重复。
回复

使用道具 举报

PLC编程高手 2021-2-22 17:25:59 显示全部楼层
楼主威纶通应用的炉火纯青啊。
向你学习。

回复

使用道具 举报

PLC编程高手 发表于 2021-2-22 17:25
楼主威纶通应用的炉火纯青啊。
向你学习。

高手过招,招招握手
高手你好,你好。
回复

使用道具 举报

初学者 2021-2-22 17:28:56 显示全部楼层
工控终极高手 发表于 2021-2-22 17:27
高手过招,招招握手。
高手你好,你好。

叫我情何以堪。


编程吧好多是原创的资源,
挺好。

回复

使用道具 举报

qq263946146 楼主 2021-2-22 17:30:21 显示全部楼层

我也是接活做项目的。
好东西,我去除版权后会供大伙参考学习的
记录编程点滴,分享编程资源。
回复

使用道具 举报

我叫一建平 2021-10-14 12:38:41 显示全部楼层
我0基础,刚开始学宏编程。
下载了楼主的例程,例程只是一个举例。
我现在想在多个窗口都可以实现拼音输入中文。
不知道怎么下手啊。
楼主能不能再帮我写个实例,搞10个可以中文输入的编译框。
我自己分配到其他窗口用?
回复

使用道具 举报

qq263946146 楼主 2021-10-14 14:34:04 显示全部楼层
我叫一建平 发表于 2021-10-14 12:38
我0基础,刚开始学宏编程。
下载了楼主的例程,例程只是一个举例。
我现在想在多个窗口都可以实现拼音输 ...

感谢红包,很乐意帮您写程序。

想在多个窗口都可以实现拼音输

想在多个窗口都可以实现拼音输

搞了10个编程框来输入中文。
更多可下载程序举一反三。都带注释。
功能如上图。
点击某个编辑框,可打开中文输入小窗口,通过拼音输入中文。
左侧对应的指示灯会点亮表示其对应编辑框被选中,正在输入中文中.
当然这些指示灯可选择不用。删除就好。
输入完后,灯复位,编辑框内容刷新。

充值会员可享会员特权,免费重复下载附件
请点击此处下载

查看状态:需购买或无权限

您的用户组是:游客

文件名称:威纶触摸屏如何使用拼音输入中文.rar 
文件大小:1.68 MB 
下载权限: 捐助会员 以上或 VIP会员   [购买捐助会员]   [充值积分]   有问题联系我



回复

使用道具 举报

点击查看
快速回复 返回列表 客服中心 搜索