Hi,
the first thing to say is, that I am new to this mailing list. The second thing is, to explain why I´m writing this mail: Weeks ago I started to convert the OSCAT Library in order to make it usable with Beremiz and derived products like OpenPLC. This project is almost done (OSCAT basic 3.3.3 and OSCAT building). You can find more Information and the Libs for downloading here https://openplc.discussion.community/?forum=751065 http://www.oscat.de/community/index.php/board,22.0.html?PHPSESSID=969hv43ateh6odcr2kg7uff549 During the conversion process I found some bugs and problems. I´m hoping to change the project from "almost done" into "100% done" with the aid of the members of this mailing list: 1) Error if declaring arrays of arrays.
2)XXX_TO_TIME
3)String handling
Thanks in advance, Yours Carsten Krabs _______________________________________________ Beremiz-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/beremiz-devel |
Administrator
|
Hi Carsten, thank you very much for the work! That was on my TODO list for a long time. Could you please share your library somewhere where login isn't required to download. Good place would be source control system like gitlab.com or github.com. Could you please add instruction how to include your library into Beremiz/PLCOpenEditor in Beremiz wiki: Can't say much about
DINT_TO TIME. I don't have access to the IEC 65131-5 standard right now. But I'm afraid it's says "implementation dependent". Mario knows for sure. On Sat, Oct 12, 2019 at 2:19 AM Carsten Krabs via Beremiz-devel <[hidden email]> wrote:
_______________________________________________ Beremiz-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/beremiz-devel |
In reply to this post by Beremiz-Devel mailing list
Where I will get source code for OSCAT library?
-- Sent from: http://beremiz-devel.2374573.n4.nabble.com/ _______________________________________________ Beremiz-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/beremiz-devel |
In reply to this post by skv
On Saturday, October 12, 2019 08:31:47 Andrey Skvortsov wrote:
> Hi Carsten, > > thank you very much for the work! That was on my TODO list for a long time. > Could you please share your library somewhere where login isn't required to > download. Good place would be source control system like gitlab.com or > github.com. > Could you please add instruction how to include your library into > Beremiz/PLCOpenEditor in Beremiz wiki: > https://bitbucket.org/automforge/beremiz/wiki/Home > > > Can't say much about DINT_TO TIME. I don't have access to the IEC 65131-5 > standard right now. But I'm afraid it's says "implementation dependent". > Mario knows for sure. > Yes, this is implementation dependent. IEC 61131-3, edition 2 Section 2.5.1.5.1 "The effects of type conversions on accuracy, and the types of errors that may arise during execution of type conversion operations, are implementation- dependent parameters." This also shows up as an implementation dependent parameter in Annex D. IEC 61131-3, edition 3 Section 6.6.2.5.2 "The effects of type conversions on accuracy, and the types of errors that may arise during execution of type conversion operations, are Implementer specific." Some sections follow describing in detail how type conversions should work (some are value preserving, others not), but DINT_TO_TIME is not covered in any subsequent sub-chapter. NOTE: IEC 61131-5 defines FBs for communications between PLCs. It is simply called "Communications". > On Sat, Oct 12, 2019 at 2:19 AM Carsten Krabs via Beremiz-devel < > > [hidden email]> wrote: > > Hi, > > the first thing to say is, that I am new to this mailing list. The second > > thing is, to explain why I´m writing this mail: > > > > Weeks ago I started to convert the OSCAT Library in order to make it > > usable with Beremiz and derived products like OpenPLC. This project is > > almost done (OSCAT basic 3.3.3 and OSCAT building). > > 3)String handling > > > > This is a bit tricky. The Libs for the different platforms are going > > different ways: Codesys is using Pointers which are no part of the IEC > > until 61131-3 2nd edition. I found some hints, that they might be included > > in 31131-3 3rd edition. PCWORX uses own functions belonging to their > > firmware which is not open. So I can´t see what these functions are doing. > > If someone sees an opportunity of resolving this problem, I would like to > > discuss it separately. > > Carsten, please note that the underlying matiec compiler already supports pointers, following the syntax defined in IEC 61131-3 edition 3. I implemented this quite some time ago upon request by a company using matiec but not Beremiz. You need to add a command line option to have the compiler accept this syntax. Running ./iec2c will list all available options. Let me see now... -r : allow use of references (REF_TO, REF, ^, NULL) (an IEC 61131-3 v3 feature) -R : allow use of REF_TO ANY datatypes (a non-standard extension!) as well as REF_TO in ARRAYs and STRUCTs (a non-standard extension!) Does this help? Cheers, Mario _______________________________________________ Beremiz-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/beremiz-devel |
On Thursday, January 02, 2020 10:07:36 Mario de Sousa via Beremiz-devel wrote:
> On Saturday, October 12, 2019 08:31:47 Andrey Skvortsov wrote: > > Hi Carsten, > > > > thank you very much for the work! That was on my TODO list for a long > > time. > > Could you please share your library somewhere where login isn't required > > to > > download. Good place would be source control system like gitlab.com or > > github.com. > > Could you please add instruction how to include your library into > > Beremiz/PLCOpenEditor in Beremiz wiki: > > https://bitbucket.org/automforge/beremiz/wiki/Home > > > > > > Can't say much about DINT_TO TIME. I don't have access to the IEC 65131-5 > > standard right now. But I'm afraid it's says "implementation dependent". > > Mario knows for sure. > > Yes, this is implementation dependent. > BTW, it is relatively easy to change the behaviour of the DINT_TO TIME function, or to add a new function with the behaviour you desire. These functions are in the standard library, and so are not implemented inside the compier itself, but are instead included into the code compiled by matiec compiler. You can see the current implementation for DINT_TO TIME in file matiec/lib/C/iec_std_lib.h Search for the function, __int_to_time() This functions is used to implement all integer types (INT, DINT, LINT, UINT, UDINT, ULINT) to TIME __int_to_time, using macros in file matiec/lib/C/iec_std_functions.h I havent compiled and tested this, but you would probably need to change the __int_to_time() function to something along the lines of: static inline TIME __int_to_time(LINT IN) { return (TIME){(LINT)(IN / 1000), (IN % 1000)*1000000}; } ... so that the IN variable being converted to TIME type is considered as containing time in (ms) units. Cheers, Mario. _______________________________________________ Beremiz-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/beremiz-devel |
Following up with that, I wanted to add the OSCAT library converted by
Carsten to Beremiz (and also to OpenPLC Editor, which is a fork from Beremiz). As much as I understand from the code, it seems that adding custom blocks is a lengthy and cumbersome process. So far what I have done is: 1. edit /plcopen/definitions.py and add my own custom library XML file: StdTC6Libs = [(_("Standard function blocks"), join(sd, "Standard_Function_Blocks.xml")), (_("Additional function blocks"), join(sd, "Additional_Function_Blocks.xml")), (_("My Custom Library"), join(sd, "My_Custom_Library.xml"))] 2. Create "My_Custom_Library.xml file and fill out the name, version, etc and also add all the POUs that I want on my library. This is enough to have my library and my custom blocks to show up on the editor. However, when I try to compile the code, MatIEC complains about a lot of things. So to actually get the code compiled, I have to: 1. Create a my_custom_library.txt at /matiec/lib with the structured text code of all my blocks 2. Edit /matiec/lib/C/iec_stf_FB.h and /matiec/lib/C/iec_stf_FB_no_ENENO.h files and include the C source implementation of all my blocks! The last step is quite hard to do for a library with more than 100 custom blocks! Is there a way to just avoid the modifications to MatIEC and have my blocks added to the editor's library? Instead of having to manually write my C code implementation of my custom blocks, can I rely on MatIEC to do it for me based on the Structured Text included in the My_Custom_Library.xml file? Thanks! Thiago Alves -- Sent from: http://beremiz-devel.2374573.n4.nabble.com/ _______________________________________________ Beremiz-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/beremiz-devel |
Free forum by Nabble | Edit this page |