OSCAT搴撴枃浠舵簮浠g爜_ST璇█2020_3_5.pdf_OSCAT搴撴枃浠舵簮浠g爜_ST璇█ - 閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛

閰峰痉缃

HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鎼滅储闄勪欢  
閰峰痉缃 闄勪欢涓績 CODESYS璧勬簮涓嬭浇鍖 CODESYS搴撲笅杞 OSCAT搴撴枃浠舵簮浠g爜_ST璇█2020_3_5.pdf

OSCAT搴撴枃浠舵簮浠g爜_ST璇█2020_3_5.pdf

 

OSCAT搴撴枃浠舵簮浠g爜_ST璇█:
OSCAT搴撴枃浠舵簮浠g爜_ST璇█锛岀紪鍐欑殑寰堢簿鑷达紝寰堜紭绉锛屽叡鍚屽涔犱竴涓嬶紝鍝堛
(* @NESTEDCOMMENTS := 'Yes' *)
(* @PATH := '\/Buffer Management' *)
(* @OBJECTFLAGS := '0, 8' *)
(* @SYMFILEFLAGS := '2048' *)
FUNCTION _BUFFER_CLEAR : BOOL
VAR_INPUT
        PT: POINTER TO BYTE;
        SIZE: UINT;
END_VAR
VAR
        ptw: POINTER TO DWORD;
        tempWORD;
        end,end32 : DWORD;
END_VAR
(*
version 1.2    31.oct. 2008
programmer     hugo
tested by      oscat
this function will initialize a given arrayof byte with 0.
the function needs to be called:      _buffer_clear(adr("array"),sizeof("array"));
this function will manipulate a given array.
the function manipulates the original array,it rerturnes true when finished.
because this function works with pointers itsvery time efficient and it needs no extra memory.
*)
(* @END_DECLARATION := '0' *)
(* this routine uses 32 bit access to gainspeed *)
(* first access bytes till pointer is alignedfor 32 bit access *)
temp := pt;
end := temp + UINT_TO_DWORD(size);
end32 := end - 3;
WHILE (pt < end) AND ((temp AND16#00000003) > 0) DO
        pt^:= 0;
        pt:= pt + 1;
        temp:= temp + 1;
END_WHILE;
(* pointer is aligned, now copy 32 bits at atime *)
ptw := pt;
WHILE ptw < end32 DO (* *)
        ptw^:= 0;
        ptw:= ptw + 4;
END_WHILE;
(* copy the remaining bytes in byte mode *)
pt := ptw;
WHILE pt < end DO
        pt^:= 0;
        pt:= pt + 1;
END_WHILE;
_BUFFER_CLEAR := TRUE;
(* revision History
hm      5.mar. 2008   rev 1.0
        originalversion
hm      16.mar. 2008  rev 1.1
        addedtype conversion to avoid warnings under codesys 30
        chagedtype of input size to uint
        deletedunused variable i
hm      31.oct. 2008  rev 1.2
        correctedan error while routine would write outside of arrays
*)
END_FUNCTION


[hide]
                               
                                [/hide]
姝eソ闇瑕佽繖涓簱锛屽涔犱簡
瀛︿範涓嬶紝杩欎釜鏄▼搴忓簱鏂囦欢鐮侊紝璋㈣阿鍒嗕韩
鎰熻阿妤间富鏃犵鐨勭殑鍒嗕韩
鎴戜滑涓庢ゼ涓诲叡鍚岃繘姝
http://bbs.hicodesys.com/home.ph ... ;op=rule&fid=36
閭d釜鐗堟湰鐨勶紝鏈夋簮浠g爜鍙互鍊熼壌
杩欎釜閮芥湁锛  鎴戣繕浠ヤ负鏄畼鏂圭殑搴撳憿
鏈璁ㄥ帉鍏堝洖澶嶅湪鐪嬬湅鐨
OSCAT搴撴枃浠舵簮浠g爜_ST璇█
鍜斿挃鍜斿挃鍜斿挃鎵╂墿鎵╂墿鎵╂墿鎵╂墿鎵╂墿
1111111111111111111111111111111111111111111111
搴撴枃浠讹紝鍙洿鎺ュ畨瑁呫
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
OSCAT搴撴枃浠舵簮浠g爜_ST璇█
椤堕《椤堕《椤堕《椤堕《椤堕《
璋㈣阿鍒嗕韩锛屼笅杞藉涔犲涔
鎴戝幓锛屽垰鐪嬩簡涓涓壘涓嶅埌浜
椤堕儴qrcode搴曢儴
鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

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

GMT+8, 2024-11-23 23:37 , Processed in 0.100925 second(s), 21 queries .

閰峰痉缃

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

杩斿洖椤堕儴