Higher-Level-TwinCAT-3-Library

所属分类:GIS/地图编程
开发工具:Others
文件大小:0KB
下载次数:0
上传日期:2023-06-18 15:58:54
上 传 者sh-1993
说明:  库应提供一组抽象对象,如在高级编程语言中常见的列表或地图,即,它旨在简化...,
(Library should offer set of abstract objects such as Lists or Maps common in higher lever programming languages, i.e. it is meant to easily provide some modern tools to every TwinCAT developer.)

文件列表:
ListTest/ (0, 2023-06-18)
ListTest/ListTest.tsproj (1413, 2023-06-18)
ListTest/Untitled1/ (0, 2023-06-18)
ListTest/Untitled1/POUs/ (0, 2023-06-18)
ListTest/Untitled1/POUs/ListOfTest.TcPOU (418, 2023-06-18)
ListTest/Untitled1/POUs/MAIN.TcPOU (1069, 2023-06-18)
ListTest/Untitled1/POUs/NodeOfTest.TcPOU (1056, 2023-06-18)
ListTest/Untitled1/PlcTask.TcTTO (684, 2023-06-18)
ListTest/Untitled1/Untitled1.plcproj (7331, 2023-06-18)
ListTest/Untitled1/_Libraries/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc2_standard/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc2_standard/3.3.3.0/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc2_standard/3.3.3.0/tc2_standard.compiled-library (43951, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc2_system/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc2_system/3.4.25.0/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc2_system/3.4.25.0/tc2_system.compiled-library (167540, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc3_module/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc3_module/3.3.21.0/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/beckhoff automation gmbh/tc3_module/3.3.21.0/tc3_module.compiled-library (72806, 2023-06-18)
ListTest/Untitled1/_Libraries/tomas rompotl/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/tomas rompotl/high level object twincat 3 library/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/tomas rompotl/high level object twincat 3 library/0.0.1/ (0, 2023-06-18)
ListTest/Untitled1/_Libraries/tomas rompotl/high level object twincat 3 library/0.0.1/hl3.library (390670, 2023-06-18)
TcList.sln (4695, 2023-06-18)
TcList/ (0, 2023-06-18)
TcList/HL3/ (0, 2023-06-18)
TcList/HL3/DataProcessing/ (0, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/ (0, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/CompareAnyType.TcPOU (1007, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/ComparisonTest.TcPOU (1453, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/E_Compare.TcDUT (413, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/IsEqualAnyType.TcPOU (768, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/IsGreaterThanAnyType.TcPOU (3436, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/IsGreaterThanOrEqualAnyType.TcPOU (613, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/IsLessThanAnyType.TcPOU (3346, 2023-06-18)
TcList/HL3/DataProcessing/Comparison/IsLessThanOrEqualAnyType.TcPOU (607, 2023-06-18)
... ...

# Higher-Level-TwinCAT-3-Library #HL3 Library should offer set of abstract objects such as Lists or Maps common in higher lever programming languages, i.e. it is meant to easily provide some modern tools to every TwinCAT developer. I would like to thank [Jakob Sagatowsky](https://github.com/sagatowski) and [TcOpen](https://github.com/TcOpenGroup/TcOpen) for their opensource projects as I use them to gather knowledge and are inpiration for me. Thx! ** See my other and more up to date project "[Simple Yet Complex](https://github.com/theshamot/tc-syc)" for TwinCAT. This library will be merged in there.** --- ## Current status ### Lists - Dynamically allocated elements = list has variable length - Does not support RETAIN - Methods: - `Append(data)` - `Prepend(data)` - `Insert(int index, data)` - `Get(int index)` - `Remove(int index)` - `RemoveAll()` - `IsEmpty()` - Supports negative indexing (Get(-1) returns last element) - Methods can be chained (myList.Append(2).Append(3).Prepend(1)) - Project contains PRGs with example usages of methods - ListOfINT can only carry INT data - List(of ANY) - Can carry ANY datatype you send in - Upon adding the first data to List it remembers its datatype. When adding another data to list it checks its datatype and if it is valid it continues by adding the data. - It can recognize primitive datatypes. All structures and FBs are recognized as USERDEF datatypes and are only compared based on its byte size - Only variables can be passed as data. i.e. you cannot do ~~`Append(5)`~~, you can only `Append(myVariable)` - When retrieving data from List using `Get(int index, ANY destinationVariable)` function you also pass the variable you want to write data to. The variable is checked on its compatibility and if datatype is valid then data are written into the variable. - When adding or retrieving data from List the datatype is checked. If the datatype is not valid it will RETURN without doing anything - WIP wrapper example for List of Custom datatype. You can access object properties using dot notation `myList.Get(0).VarBOOL`. ### Sort - Sorts array of anything using quicksort algorythm. - Array can be sorted by ascending or descending order. - It is designed to be able sort by nested element. That means you can sort array of structures/fbs by its member variable (e.g. You have struct describing product. Let's say one of structures variables is time it was produced. You can sort the array by this time.) - Syntax: `Sort(array, firtElementOfArray, sortByVariable, order)`. `firstElementOfArray` points to arrays first index, `sortByVariable` points to variable you want to sort by as refered to variable from first index of array. It can be same variable as provided in `firstElementOfArray` or member of this variable. `order` is self-explanatory. - Example syntax: Sort(sort_array, `Sort(sort_array, sort_array[0], sort_array[0].by_this.nested_variable, E_Order.ASCENDING)` ### Comparisons - Compare functions for variables passed by __SYSTEM.AnyType description. - Can compare numbers, times, strings and some other datatypes. ### Others - Conversion of __SYSTEM.AnyType to String or WString - Swap to swap byte content of any two variables with matching size - Some general usage enumerators --- ## What's ahead. Only future will show which of these are actually possible in Tc - ListOf\ - List.Contains(value) : int index - List.Sort() - Map based on List - List, Map.JSON() - you could possibly backup data to file when you cannot make this retain over restart - Strigifier - convert anything to string including fb properties. This could also contain JSONizer. - ? Some sort of variable logger? Example: Logger.Log(__VARINFO). Using __VARINFO we can get variable name in addition to its value.

近期下载者

相关文件


收藏者