codesys鎸囦护琛-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 2393|鍥炲: 1

codesys鎸囦护琛

[澶嶅埗閾炬帴]
  • TA鐨勬瘡鏃ュ績鎯
    鎿︽睏
    2019-8-13 14:13
  • 绛惧埌澶╂暟: 32 澶

    [LV.5]甯镐綇灞呮皯I

    鍙戣〃浜 2013-12-2 11:19:54 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡

    CoDeSys V2.3鑷畾涔夊姛鑳藉潡锛堟椂闂达級 VAR_OUTPUT

    CUR_Y:REAL; (*褰撳墠骞*)

    CUR_M:REAL;(*褰撳墠鏈*)

    CUR_D:REAL;(*褰撳墠鏃*)

    CUR_H:REAL;(*褰撳墠鏃*)

    CUR_Min:REAL;(*褰撳墠鍒*)

    CUR_S:REAL;(*褰撳墠绉*)

    CUR_mS:REAL;(*褰撳墠姣*)

    END_VAR

    VAR

    DAY_C: DWORD;

    AAA: HSRTC;(*鏃堕棿鍔熻兘鍧*)

    BBB: DWORD;(*鎬诲ぉ鏁*)

    CCC: DWORD;(*鑷1970骞撮棸骞存暟*)

    DAY_H: DWORD;

    MX: ARRAY [0..12] OF DWORD:=0,31,28,31,30,31,30,2(31),30,31,30,31;(*姣忎釜鏈堢殑澶╂暟*) AX: ARRAY [0..12] OF DWORD;(*鑷虫煇鏈堢殑澶╂暟*)

    I1:INT;

    END_VAR

    ----------------------------------------------

    -----------------------------------------------

    AAA();

    BBB:=AAA.ss/86400;

    CCC:=(BBB+365)/(4*365);

    DAY_H:=(AAA.ss)MOD(86400);

    (*褰撳墠骞*)

    CUR_Y:=DWORD_TO_REAL((BBB-CCC)/365+1970);

    DAY_C:=(BBB-CCC)MOD(365);

    IF (REAL_TO_DWORD(CUR_Y))MOD(4)=0 THEN

    MX[2]:=29;

    ELSE

    MX[2]:=28;

    END_IF

    AX[0]:=0;

    MX[0]:=0;

    FOR I1:=1 TO 12 BY 1 DO

    AX[I1]:=MX[I1]+AX[I1-1];

    (*褰撳墠鏈,褰撳墠鏃*)

    IF DAY_C>=AX[I1-1] AND DAY_C<AX[I1] THEN

    CUR_M:=I1;

    CUR_D:=DAY_C-AX[I1-1]+1; ELSE

    CUR_M:=CUR_M;

    CUR_D:=CUR_D;

    END_IF

    END_FOR;

    (*褰撳墠鏃*)

    CUR_H:=DAY_H/3600;

    (*褰撳墠鍒*)

    CUR_Min:=DAY_H/60-CUR_H*60; (*褰撳墠绉*)

    CUR_S:=DAY_H-CUR_H*3600-CUR_Min*60; (*褰撳墠姣*)

    CUR_mS:=AAA.ms;


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

    浣跨敤閬撳叿 涓炬姤

  • TA鐨勬瘡鏃ュ績鎯
    閮侀椃
    2021-11-29 11:47
  • 绛惧埌澶╂暟: 2 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2021-11-27 14:11:26 | 鏄剧ず鍏ㄩ儴妤煎眰
    鐨     鎯12313
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

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

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

    GMT+8, 2024-11-23 20:57 , Processed in 0.156797 second(s), 61 queries .

    閰峰痉缃

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

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