蓝色港湾 发表于 2023-4-12 21:56:19

codesys开源库OSCATBasic.package+使用说明pdf+ST语言源码文件

一、OSCATBasic介绍

OSCATBasic是一个开源库,包含丰富的算法函数;在CODESYS资源库里打开后,在库管理器里安装后,即可在程序中使用。有对应的源码文件,可以学习其优秀的ST算法编程,提升能力;例如文中大量采用了指针操作,可以加深对指针的理解;
二、 内容介绍

包括一下三个文件:
库文件库源码文件使用教程文档


《教程文档.pdf》




《OSCATBasic库源码》

例如函数 _BUFFER_CLEAR,其代码如下
(* @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;
        temp: DWORD;
        end, end32 : DWORD;
END_VAR


(*
version 1.231. oct.2008
programmer         hugo
tested by        oscat

this function will initialize a given array of 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 its very time efficient and it needs no extra memory.*)(* @END_DECLARATION :='0'*)(* this routine uses 32 bit access to gain speed *)(* first access bytes till pointer is aligned for32 bit access *)
temp := pt;
end := temp +UINT_TO_DWORD(size);
end32 := end -3;
WHILE (pt < end) AND ((temp AND 16#00000003)>0) DO
        pt^:=0;
        pt := pt +1;
        temp := temp +1;
END_WHILE;(* pointer is aligned, now copy 32 bits at a time *)
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;

wx_4193162051 发表于 2023-4-13 13:46:02

看看有什么重要文件

suntech 发表于 2023-4-23 16:36:00

文件在哪里了呢?

Martlet 发表于 2023-5-5 10:55:06

看看,是不是真的

李宁dd 发表于 2023-5-9 11:04:01

文件在哪看不到

hqyylove 发表于 2023-9-15 09:17:36

压根就没上传文件吧!
页: [1]
查看完整版本: codesys开源库OSCATBasic.package+使用说明pdf+ST语言源码文件