Codesys 鐢⊿T璇█璇诲啓XML鏂囦欢璇存槑 + 浠g爜涓嬭浇-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 1729|鍥炲: 1

Codesys 鐢⊿T璇█璇诲啓XML鏂囦欢璇存槑 + 浠g爜涓嬭浇

[澶嶅埗閾炬帴]
  • TA鐨勬瘡鏃ュ績鎯
    鎱垫噿
    2017-11-9 20:49
  • 绛惧埌澶╂暟: 2 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2023-4-12 22:17:33 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    涓銆佸紑鍙戠幆澧冭鏄

      缂栫▼杞欢锛 Codesys V3.5 SP17杩愯璁惧锛歅C鐢佃剳缂栫▼璇█锛 ST
    浜屻侀厤缃搷浣

    1銆佹柊寤篊odesys宸ョ▼锛屼緷娆$偣鍑汇愭枃浠躲戔斻愭柊寤哄伐绋嬨戔斻愭爣鍑嗗伐绋嬨戔 杈撳叆鍚嶇О锛屽涓嬪浘鎵绀

    Codesys 鐢⊿T璇█璇诲啓XML鏂囦欢璇存槑 + 浠g爜涓嬭浇-1.png


    2銆佹坊鍔犱緷璧栧簱鏂囦欢锛屼緷娆$偣鍑汇愬簱绠$悊鍣ㄣ戔斻愭坊鍔犲簱銆戔撱愰珮绾с戔 杈撳叆搴撳悕绉 鈥斻愮‘瀹氥戯紝濡備笅鍥炬墍绀

    闇瑕佹坊鍔犵殑搴擄細
      SysFile 锛 璇绘枃浠剁殑鎿嶄綔StringUtils 锛氳瀛楃涓茬殑鎿嶄綔SysTypes2 Interfaces 锛氬畾涔夌浉鍏崇殑鏁版嵁缁撴瀯銆佺被鍨
    Codesys 鐢⊿T璇█璇诲啓XML鏂囦欢璇存槑 + 浠g爜涓嬭浇-2.png

    Codesys 鐢⊿T璇█璇诲啓XML鏂囦欢璇存槑 + 浠g爜涓嬭浇-3.png


    3銆佽鍐欐枃浠剁殑鍑芥暟锛

    鐢ㄥ埌鐨勪富瑕佸簱鍑芥暟
    鍑芥暟鍚璇存槑
    SysFileOpen鎵撳紑鎴栧垱寤烘枃浠讹紝骞惰繑鍥炴枃浠跺彞鏌勩
    SysFileClose鍏抽棴鍙ユ焺鎸囧畾鐨勬枃浠
    SysFileRead浠庢枃浠朵腑璇诲彇瀛楄妭
    SysFileWrite寰鏂囦欢涓啓鍏ュ瓧鑺
    SysFileGetPos鑾峰彇褰撳墠鏂囦欢鎸囬拡鐨勪綅缃
    4銆佸湪PLC_PRG涓紪鍐欎唬鐮侊紝璋冪敤鍑芥暟瀹炵幇XML鏂囦欢鎿嶄綔
    1. (*0 initial *)
    2.         iPeopleIndex :=0;(*1 open file*)
    3.     pbyteFileHandle:=SysFileOpen(szFile:= strFileName, am:= ACCESS_MODE.AM_READ_PLUS,pResult:=ADR(udiResult));(*2 read file*)WHILE(FC_FileReadLine(pbyteFileHandle,strLineValue =>strTempLine,wSize=>wLineSize)) DO
    4.            StrToUpperA(ADR(strTempLine));IF(FIND(  strTempLine,'<PEOPLE>')<>0) THEN
    5.                  FC_FileDealLine( pbyteFileHandle,TRUE ,'NAME',ADR(struPeople[iPeopleIndex].strName), E_DataType.eType_STRING );FC_FileDealLine( pbyteFileHandle,TRUE ,'AGE',ADR(struPeople[iPeopleIndex].uiAge), E_DataType.eType_INT    );FC_FileDealLine( pbyteFileHandle,TRUE ,'HEIGHT',ADR(struPeople[iPeopleIndex].rHeighT), E_DataType.eType_REAL   );FC_FileDealLine( pbyteFileHandle,TRUE ,'student',ADR(struPeople[iPeopleIndex].bStudent), E_DataType.eType_BOOL   );
    6.                                  iPeopleIndex := iPeopleIndex +1;
    7.                
    8.             END_IF   
    9.     END_WHILE(*3 close file*)SysFileClose(hFile := pbyteFileHandle);
    澶嶅埗浠g爜
    涓夈佺紪鍐檆odesys鐣岄潰锛岃繘琛屾晥鏋滃睍绀

    Codesys 鐢⊿T璇█璇诲啓XML鏂囦欢璇存槑 + 浠g爜涓嬭浇-4.gif


    鍥涖佷唬鐮佷笅杞
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

    椤堕儴qrcode搴曢儴
    鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

    QQ|灏忛粦灞|鎵嬫満鐗|Archiver|閰峰痉璁哄潧 ( 鑻廔CP澶16065247鍙-1 )|缃戠珯鍦板浘

    GMT+8, 2024-11-27 11:24 , Processed in 0.155399 second(s), 64 queries .

    閰峰痉缃

    © 2001-2013 Hicodesys. 鎶鏈敮鎸 by 閰峰痉缃

    蹇熷洖澶 杩斿洖椤堕儴 杩斿洖鍒楄〃