You might know the OSCAT library (http://www.oscat.de). If not: This library contains a vast number of different functions (FC) and function blocks (FB) (didn´t count them, but probably up to 1000)! It free for private and commercial use. In the download section you will find “ready to use” libs for Codesys, S7, PCWorx and a *.xml file as well. The three major topics (basic, building and network) are divided int several sub-sections. Every single FC or FB is described in delated documents, provided in English as well.
Unfortunately, no lib for OpenPLC.
Because I found out this lib to be very helpful in many cases I started recently converting it, in order to use it with OpenPLC.
Attached you´ll find the whole maths-section of the OSCAT basic library.
It contains 65 mathematical functions which might be very useful. I know it´s only 10% of the whole lib, but without starting you will not get anyhere.
As far as I know, there is no way to “import” a whole library into OpenPLC as it is. I followed Mr. Alves’ recommendations and put all the created FC / FB´s into an empty project (“OSCAT Maths” in the zip folder). To use the FC / FB´s in your project just copy-paste (C/P) the desired item into your project. You might receive an error while simulation in some cases. Don´t worry, it´s typical for OSCAT, that some FC / FB refer to another one. Just take a look to the ST code, you will find a comment, which FC / FB is required (hope I didn´t forget any 😊). C/P the missing one as well and you will be fine.
Be aware, that due to the missing import possibility everything must be done manually (C/P ST-code, modify code in some cases, declaring variables, checking and running simulation...). This might be prone to errors. I tested every FC / FB, but you never know…So don´t beat me up if you find a bug, just fix it and post. I added a brief description to every FC / FB. If you need more detailed information, download the regarding document (in this case Oscat basic Ver. 3.33; German PDF, English epup) form the download section (http://www.oscat.de).
To enrich this great OpenPLC project I would like to invite everyone who is interested in, to convert a part of the library. I suggest to post the regarding section here to prevent double activity (E.G: I´m going to convert the xxxxx-section of the Oscat lib). Myself I´m going on with the arithmetic functions.
The next lines are heading more or less to Mr. Alves himself.
There is a noteworthy number of important FC /FB´s using the basic Function “T_PLC_MS” or “T_PLC:US”. I´ve got no idea how to make OpenPLC compatible FC out of them. I attached a PDF file (“Mr_Alves”) containing the ST code of one example FB and the ST code of “T_PLC_MS” and “T_PLC_US” and the detailed description as well. There are two different approaches to T_PLC_MS and US. One I took from the lib for PLC Worx and one from the Codesys lib. I tried both, but without success. It would be great if you could help in this case. If this issue is solved, I can go on with the more complex FB´s.