OSCAT库文件源代码_ST语言2020_3_5.pdf_OSCAT库文件源代码_ST语言 - 酷德网 - CoDeSys软件教程下载,CoDeSys工控资讯门户 

酷德网

HSC6490-cn中国制造,中国芯~
搜索附件  
酷德网 › 附件中心 › CODESYS资源下载区 › CODESYS库下载 › OSCAT库文件源代码_ST语言2020_3_5.pdf

OSCAT库文件源代码_ST语言2020_3_5.pdf

 

OSCAT库文件源代码_ST语言:
OSCAT库文件源代码_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]
正好需要这个库,学习了
学习下,这个是程序库文件码,谢谢分享
感谢楼主无私的的分享
那个版本的,有源代码可以借鉴
这个都有?  我还以为是官方的库呢
最讨厌先回复在看看的
OSCAT库文件源代码_ST语言
咔咔咔咔咔咔扩扩扩扩扩扩扩扩扩扩
1111111111111111111111111111111111111111111111
库文件,可直接安装。
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
OSCAT库文件源代码_ST语言
顶顶顶顶顶顶顶顶顶顶
谢谢分享,下载学习学习
我去,刚看了一个找不到了
好东西

好东西

好东西

谢谢分享,学习学习再学习。
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
正好需要这个库,学习了

顶部qrcode底部
关注酷德网订阅号,获取更多资讯!

QQ|Archiver|手机版|小黑屋|酷德论坛 ( 苏ICP备16065247号-1 )|网站地图

GMT+8, 2026-10-19 12:20 , Processed in 0.103656 second(s), 22 queries .

酷德网

© 2001-2013 Hicodesys. 技术支持 by 酷德网

返回顶部