瑙e喅codesys姣2灏忔椂鎺夌嚎鍙婁笌浣跨敤鍏朵粬缁勪欢涓嚱鏁版柟娉-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 1656|鍥炲: 0

瑙e喅codesys姣2灏忔椂鎺夌嚎鍙婁笌浣跨敤鍏朵粬缁勪欢涓嚱鏁版柟娉

[澶嶅埗閾炬帴]

璇ョ敤鎴蜂粠鏈鍒

鍙戣〃浜 2023-4-20 13:01:18 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
瑙e喅codesys Runtime姣2灏忔椂鎺夌嚎

娉ㄦ剰锛氬繀椤昏喘涔癱odesys鐩稿叧缁勪欢鎵嶅彲浠ヨ繘琛屼互涓嬭缃紱灏3s_INFO.txt涓璉D澶嶅埗鍒颁互涓嬮摼鎺ュ垱寤虹敓鎴愮殑妯℃澘搴撲腑鍗冲彲銆

瑙e喅codesys姣2灏忔椂鎺夌嚎鍙婁笌浣跨敤鍏朵粬缁勪欢涓嚱鏁版柟娉-1.png


妯℃澘搴撳垱寤
浣跨敤鍏朵粬缁勪欢涓嚱鏁版柟娉

娉ㄦ剰锛氶氳繃妯℃澘搴撶敓鎴愮殑CmpXKLibDep.m4鏂囦欢鍙槸鏈鍩虹鐨勶紝濡傛灉鎯宠皟鐢ㄥ叾浠栫粍浠剁殑鍑芥暟锛屾垨鑰呰鎯充笌鍏朵粬缁勪欢浜х敓鑱旂郴闇瑕佷慨鏀硅鏂囦欢銆
CmpXKLibDep.m4
  1. /**
  2. *  <name>Component Template</name>
  3. *  <description>
  4. *  An example on how to implement a component.
  5. *  This component does no usefull work and it exports no functions
  6. *  which are intended to be used for anything. Use at your own risk.
  7. *  </description>
  8. *  <copyright>
  9. *  Copyright (c) 2017-2020 CODESYS Development GmbH, Copyright (c) 1994-2016 3S-Smart Software Solutions GmbH. All rights reserved.
  10. *  </copyright>
  11. */
  12. SET_COMPONENT_NAME(`CmpXKLib')   /* 缁勪欢鍚嶇О */
  13. COMPONENT_SOURCES(`CmpXKLib.c')  /* 缁勪欢婧愮爜 */
  14. COMPONENT_VERSION(`0x03051000')  /* 缁勪欢鐗堟湰 */
  15. /* NOTE: REPLACE 0x0001 BY YOUR VENDORID */
  16. COMPONENT_VENDORID(`0x177d')        /* 鍘傚晢ID,璁剧疆鍚庡彲浠ヨВ闄2灏忔椂鐧诲綍涓娆¢檺鍒讹紝浠巆odesys鎻愪緵鐨勬簮鐮佽В鍘嬪悗鎵惧埌Western_0x1_ARM_VxWorks_V3.5.16.40_XsCZMASIHS\Configuration\3S_INFO.txt 涓彲浠ユ壘鍒 */                       
  17. #define CMPID_CmpXKLib                0x2000                                                                /* NOTE: START HERE WITH YOUR COMPONENTIDS (see CmpItf.h */ /* 缁勪欢ID codesys淇濈暀0x0001-0x1fff 浠0x2000-0x3FFF鏄垜浠彲浠ヤ娇鐢ㄧ殑锛涚粍浠剁鐞嗗櫒閫氳繃缁勪欢ID杩涜鍒ゆ柇褰撳墠缁勪欢骞惰繘琛岀鐞*/
  18. #define CLASSID_CCmpXKLib        ADDVENDORID(CMP_VENDORID, 0x2000)        /* NOTE: START HERE WITH YOUR CLASSIDS (see CmpItf.h */    /* class ID */
  19. #define ITFID_ICmpXKLib                ADDVENDORID(CMP_VENDORID, 0x2000)        /* NOTE: START HERE WITH YOUR INTERFACEIDS (see CmpItf.h */ /* INFO ID */
  20. CATEGORY(`Templates')  /* 鍙奖鍝嶈8璺戠殑RUNTIME 甯︽湁鎿嶄綔绯荤粺鐨剅untime娌℃湁褰卞搷 */
  21. USE_ITF(`CMUtilsItf.m4')  /* 褰撳墠缁勪欢闇瑕佷緷璧栫殑鍏朵粬缁勪欢鍚嶇О */
  22. USE_ITF(`SysFileItf.m4') /* 鑻ユ槸闇瑕佹坊鍔犲叾浠栫粍浠跺湪姝ゅ鍔犲嵆鍙 */
  23. IMPLEMENT_ITF(`CmpXKLibItf.m4') /*褰撳墠瀹炵幇鐨勬帴鍙*/
  24. REQUIRED_IMPORTS(                        
  25. CMUtlSafeStrCpy)                   /* 鑻ヤ笂闈㈡坊鍔犱簡鍏朵粬USE_ITF 姝ゆ灏卞彲浠ユ坊鍔犻渶瑕佷娇鐢ㄧ殑鎺ュ彛鍑芥暟锛屾娆$殑鍑芥暟鎺ュ彛蹇呴』瀹炵幇 */
  26. OPTIONAL_IMPORTS(
  27. SysFileOpen,
  28. SysFileClose,
  29. SysFileRead,
  30. SysFileWrite)  /* 姝ゆ鐨勫嚱鏁版帴鍙e彲浠ヤ笉瀹炵幇 */
澶嶅埗浠g爜
姣斿鎴戜滑鎯充娇鐢⊿ysFileItf缁勪欢鎴戜滑鍙互鎵撳紑甯姪鏂囨。锛圵estern_0x1_ARM_VxWorks_V3.5.16.40_XsCZMASIHS\Documentation\RTS-Documentation.html锛夋悳绱ysFileItf鍚庡彲浠ユ煡鐪嬫墍鏈夋湁鍏崇殑鍑芥暟
  1. 淇敼涓猴細
  2. REQUIRED_IMPORTS(
  3. CMUtlSafeStrCpy,
  4. SysFileOpen,
  5. SysFileClose,
  6. SysFileWrite)
  7. OPTIONAL_IMPORTS(
  8. SysFileRead)
  9. 姝ゆ椂浣跨敤.m4.bat閲嶆柊鐢熸垚.h鍚庝笉鍚岀偣涓猴紙READ鐨勫彲浠ヤ笉瀹炵幇鍚庨潰鍐欑殑鏄疌M_IMPORT_OPTIONAL_FUNCTION锛屽叾浣欑殑閮介渶瑕佸疄鐜帮級锛
  10. if(ERR_OK == importResult ) TempResult = GET_SysFileRead(CM_IMPORT_OPTIONAL_FUNCTION);\
  11.           if(ERR_OK == importResult ) importResult = GET_SysFileWrite(0);\
  12.           if(ERR_OK == importResult ) importResult = GET_SysFileClose(0);\
  13.           if(ERR_OK == importResult ) importResult = GET_SysFileOpen(0);\
  14.           if(ERR_OK == importResult ) importResult = GET_CMUtlSafeStrCpy(0);\
  15. 姝ゆ椂鍙互灏嗘.h鎷疯礉鍒板伐绋嬶紝鍦ㄥ伐绋嬩腑鍙互浣跨敤杩欏嚑涓嚱鏁颁簡锛屾敞鎰忚皟鐢ㄥ嚱鏁板繀椤诲姞鍓嶇紑CAL_
  16. 濡備互涓嬶細
  17. //娴嬭瘯鏂囦欢鎵撳紑SysFileOpen_ (char *pszFile, RTS_IEC_UDINT am, RTS_RESULT *pResult)
  18.         char filename[]="coswsysFileTest";
  19.         RTS_RESULT *pResult;
  20.         RTS_HANDLE handle = RTS_INVALID_HANDLE;
  21.         unsigned char buf[]="123456\n";
  22.         RTS_SIZE num;
  23.        
  24.         handle = CAL_SysFileOpen_ (filename, AM_WRITE, &pResult);
  25.         if(handle != RTS_INVALID_HANDLE)//鍒ゆ柇鏄惁鏄棤鏁
  26.         {
  27.                 num = CAL_SysFileWrite (handle, buf, sizeof(buf), &pResult);
  28.                 CAL_SysFileClose(handle);}
  29. 灏嗙紪璇戠敓鎴愮殑.out鎷疯礉鍒版澘瀛愶紝璋冪敤鍐欐閮ㄥ垎浠g爜鐨勫嚱鏁版帴鍙e嵆鍙垱寤
澶嶅埗浠g爜
鍐欐枃浠剁粨鏋滃涓嬶細

瑙e喅codesys姣2灏忔椂鎺夌嚎鍙婁笌浣跨敤鍏朵粬缁勪欢涓嚱鏁版柟娉-2.png
+10
涓嶈禐涓涓紵
鎵撹祻榧撳姳涓涓嬶紒
鍥炲

浣跨敤閬撳叿 涓炬姤

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

鏈増绉垎瑙勫垯

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

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

GMT+8, 2024-11-23 19:37 , Processed in 0.163271 second(s), 60 queries .

閰峰痉缃

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

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