[Beremiz-devel] OSCAT Library, DINT_TO_TIME, ARRAYS, MatIEC

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Beremiz-devel] OSCAT Library, DINT_TO_TIME, ARRAYS, MatIEC

Beremiz-Devel mailing list
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

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.
Example steps to reproduce the problem
a.Open Beremiz
b.Create a new project
c.Create a new Datatype, base type INT, derivation type ARRAY, named my_array with dimension 1..20
d.Create another Datatype, base type "my_array", derivation type ARRAY, named my_array_collection with dimension 1..30
e.Click back on the "my_array" datatype and Beremiz will crash showing a "IndexError: list index out of range" error

2)XXX_TO_TIME
A lot of OSCAT function block use the internal PLC Time. This is done by T_PLC_MS or T_PLC_US. Thiago Alves (openplcproject.com) wrote this code for the OSCAT Lib. Many thanks for this! It reads out the PLC system time at the base of UDINT. Several blocks require the conversion to "TIME". If done with the Beremiz editor the block are running much to fast. I believe, the problem is caused by the IEC function DINT_TO_TIME. According to the IEC it should convert to Time with an input of milliseconds. The DINT_TO TIME function of the Beremiz editor uses seconds instead. Thiago Alves supposed this to be an error with the MatIEC compiler. The same problem seems to occure the other way round (TIME_TO_XXX).

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.

Thanks in advance,
Yours Carsten Krabs  


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
skv
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] OSCAT Library, DINT_TO_TIME, ARRAYS, MatIEC

skv
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:
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

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.
Example steps to reproduce the problem
a.Open Beremiz
b.Create a new project
c.Create a new Datatype, base type INT, derivation type ARRAY, named my_array with dimension 1..20
d.Create another Datatype, base type "my_array", derivation type ARRAY, named my_array_collection with dimension 1..30
e.Click back on the "my_array" datatype and Beremiz will crash showing a "IndexError: list index out of range" error

2)XXX_TO_TIME
A lot of OSCAT function block use the internal PLC Time. This is done by T_PLC_MS or T_PLC_US. Thiago Alves (openplcproject.com) wrote this code for the OSCAT Lib. Many thanks for this! It reads out the PLC system time at the base of UDINT. Several blocks require the conversion to "TIME". If done with the Beremiz editor the block are running much to fast. I believe, the problem is caused by the IEC function DINT_TO_TIME. According to the IEC it should convert to Time with an input of milliseconds. The DINT_TO TIME function of the Beremiz editor uses seconds instead. Thiago Alves supposed this to be an error with the MatIEC compiler. The same problem seems to occure the other way round (TIME_TO_XXX).

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.

Thanks in advance,
Yours Carsten Krabs  
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel


_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel