如何优化脚本程序? 点击:818 | 回复:1



天地人二

    
  • 精华:0帖
  • 求助:0帖
  • 帖子:13帖 | 27回
  • 年度积分:0
  • 历史总积分:71
  • 注册:2003年6月14日
发表于:2003-07-23 18:43:00
楼主
我刚用Intouch7.0不久,脚本程序写得太多不知怎么来优化.各位请帮忙: IF D5ALARM>1 OR D5RSONN ==3 THEN DCODES=D5CODES; DISPRSONT=D5RSONT; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; DISPALARM=D5ALARM; WIA=D5IA;WIB=D5IB;WIC=D5IC; WOCNT=D5OCNT;WRT=D5RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D8ALARM>1 OR D8RSONN ==3 THEN DCODES=D8CODES; DISPRSONT=D8RSONT; DISPALARM=D8ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D8IA;WIB=D8IB;WIC=D8IC; WOCNT=D8OCNT;WRT=D8RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D11ALARM>1 OR D11RSONN ==3 THEN DCODES="P105/A"; DISPRSONT=D11RSONT; DISPALARM=D11ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D11IA;WIB=D11IB;WIC=D11IC; WOCNT=D8OCNT;WRT=D8RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D22ALARM>1 OR D22RSONN ==3 THEN DCODES=D22CODES; DISPRSONT=D22RSONT; DISPALARM=D22ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D22IA;WIB=D22IB;WIC=D22IC; WOCNT=D22OCNT;WRT=D22RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D25ALARM>1 OR D25RSONN ==3 THEN DCODES=D25CODES; DISPALARM=D25ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D25IA;WIB=D25IB;WIC=D25IC; WOCNT=D25OCNT;WRT=D25RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D28ALARM>1 OR D28RSONN ==3 THEN DCODES=D28CODES; DISPALARM=D28ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D28IA;WIB=D28IB;WIC=D28IC; WOCNT=D28OCNT;WRT=D28RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D31ALARM>1 OR D31RSONN ==3 THEN DCODES=D31CODES; DISPALARM=D31ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D31IA;WIB=D31IB;WIC=D31IC; WOCNT=D31OCNT;WRT=D31RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D34ALARM>1 OR D34RSONN ==3 THEN DCODES=D34CODES; DISPALARM=D34ALARM; WOCNT=D34OCNT;WRT=D34RT; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D34IA;WIB=D34IB;WIC=D34IC; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D37ALARM>1 OR D37RSONN ==3 THEN DCODES=D37CODES; DISPALARM=D37ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D37IA;WIB=D37IB;WIC=D37IC; WOCNT=D37OCNT;WRT=D37RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D52ALARM>1 OR D52RSONN ==3 THEN DCODES=D52CODES; DISPALARM=D52ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D52IA;WIB=D52IB;WIC=D52IC; WOCNT=D52OCNT;WRT=D52RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D55ALARM>1 OR D55RSONN ==3 THEN DCODES=D55CODES; DISPALARM=D55ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D55IA;WIB=D55IB;WIC=D55IC; WOCNT=D55OCNT;WRT=D55RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D58ALARM>1 OR D58RSONN ==3 THEN DCODES=D58CODES; DISPALARM=D58ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D58IA;WIB=D58IB;WIC=D58IC; WOCNT=D58OCNT;WRT=D58RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D61ALARM>1 OR D61RSONN ==3 THEN DCODES=D61CODES; DISPALARM=D61ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; ENDIF; WIA=D61IA;WIB=D61IB;WIC=D61IC; WOCNT=D61OCNT;WRT=D61RT; CALL FWriteMsg( 1 ); Show "报警"; ENDIF; IF D70ALARM>1 OR D70RSONN ==3 THEN DCODES=D70CODES; DISPALARM=D70ALARM; IF DISPRSONT=="NORM" THEN DISPRSONT="电流超高"; END



大马

  • 精华:0帖
  • 求助:0帖
  • 帖子:6帖 | 117回
  • 年度积分:0
  • 历史总积分:179
  • 注册:2002年8月06日
发表于:2003-07-23 18:43:00
1楼
使用条件脚本,执行会有效率一些。

热门招聘
相关主题

官方公众号

智造工程师