codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 1262|鍥炲: 0

codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣

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

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2023-4-20 12:40:10 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    codesys鎸囬拡浣跨敤

    鎴戜滑鍏堝畾涔変竴涓寚鍚慖NT鐨勬寚閽圥锛岀劧鍚庡畾涔変竴涓暟缁勫皢鎸囬拡鎸囧悜鏁扮粍棣栧厓绱狅紝灏辨槸鍙栦簡鏁扮粍棣栧厓绱犵殑鍦板潃銆傜劧鍚庢垜浠妸鎸囬拡鎸囧悜鐨勫湴鍧鐨勬暟鎹彇鍑烘潵锛岃祴缁欏叾浠栧彉閲忎娇鐢ㄣ俕鏄彇鎸囬拡鍐呭鐨勬剰鎬濓紝涔熷氨鏄妸鎸囬拡鎸囧悜鐨勫湴鍧鐨勬暟鎹彇鍑烘潵銆
    1. 瀹氫箟锛
    2. FUNCTION FUN_Git_CCU_VCU_Data : XK.CCU_VCU_INPUT
    3. VAR_INPUT
    4. END_VAR
    5. VAR
    6.         p:POINTER TO INT;
    7.         arr:ARRAY[0..5] OF INT:=[1,2,3,2(4)];
    8.         var1:INT;
    9.         var2:INT;
    10.         p1:POINTER TO UINT;
    11.         p2:POINTER TO USINT;
    12.         p3:POINTER TO BOOL;
    13. END_VAR

    14. 瀹炵幇鍙婁娇鐢細
    15. FUN_Git_CCU_VCU_Data := XK.CCU_VCU_I;
    16. p:=ADR(arr[0]);
    17. var1:=TO_INT(SIZEOF(arr));
    18. var1:=TO_INT(SIZEOF(arr[1]));
    19. var1:=TO_INT(SIZEOF(p));
    20. var1:=TO_INT(SIZEOF(p1));
    21. var1:=TO_INT(SIZEOF(p2));
    22. var1:=TO_INT(SIZEOF(p3));
    23. FOR var1:=0 TO TO_INT(SIZEOF(arr)/SIZEOF(arr[1])) BY 1 DO
    24.         var2:=p^;
    25.         p:=p+SIZEOF(arr[0]);
    26.         
    27. END_FOR
    澶嶅埗浠g爜
    鍔犳柇鐐硅皟璇曞涓嬶細
    鏁扮粍澶у皬涓猴細sizeof锛坕nt)6 26=12
    20210401090804326.png
    鏁扮粍涓瘡涓厓绱犵殑澶у皬涓猴細2
    codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-2.png

    楠岃瘉鎸囬拡澶у皬涓8锛堜笉璁烘寚鍚戜粈涔堟暟鎹被鍨嬶級
    codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-3.png

    鏁扮粍澶у皬璁$畻鍑芥暟sizeof(A)/sizeof(A[0])
    watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTc4NzY1Mg==,size_16,color_FFFFFF,t_70.jpg

    缁撴瀯浣撴寚閽堜娇鐢
    1. 瀹氫箟锛
    2. FUNCTION FUN_Git_CCU_VCU_Data : XK.CCU_VCU_INPUT
    3. VAR_INPUT
    4. END_VAR
    5. VAR
    6.         p5:POINTER TO CCU_VCU_INPUT;
    7.         CCU_VCUI:CCU_VCU_INPUT;
    8. END_VAR
    9. 瀹炵幇涓庝娇鐢細
    10. p5:=ADR(CCU_VCUInput);
    11. CCU_VCUI:=p5^;
    12. CCU_VCUI.A_VCU_CCU_0x862_DI.E31_CARDNO:=p5^.A_VCU_CCU_0x862_DI.E31_CARDNO;
    澶嶅埗浠g爜
    楠岃瘉锛
    鍏堢粰缁撴瀯浣撳彉閲忚祴鍊硷細妯″潡鏁伴噺璁句负10
    codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-5.png

    鍐嶆柇鐐硅皟璇曠粨鏋滃涓
    codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-6.png


    浜岀骇鎸囬拡浣跨敤
    娉ㄦ剰锛氭寚閽堝ぇ灏忓潎涓8瀛楄妭锛64浣嶇郴缁熸祴璇曪級
    codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-7.png
    codesys涔嬫寚閽堣皟鐢ㄦ暟缁勫強缁撴瀯浣-8.jpg

    浜岀骇鎸囬拡瀹氫箟鍙婂彇鍊
    watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAaHVpc2xlZQ==,size_20,color_FFFFFF,t_70,g_se,x_16.jpg



    watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAaHVpc2xlZQ==,size_20,color_FFFFFF,t_70,g_se,x_16.jpg


    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

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

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2024-11-23 20:26 , Processed in 0.151428 second(s), 59 queries .

    閰峰痉缃

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

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