Neueste Beiträge

#1
Modulentwicklung / Aw: Umstieg von Codesys 2.3 au...
Letzter Beitrag von mg - 29. September 2025, 13:36:48
I have the same time-problem. I will write you a private Message with my email. If you like maybe we can do something but I think it is NOT easy. ... maybe next year when the economy works like the last 12 months ...
Hint: I have done a lot of work for the SIEMENS oscat already (in the beginning we had a good forum, now it is not interested to report a fault) ... only for around 30-oscat functions of the SIEMENS / BASIC OSCAT I needed years to make it really 100% working.

* AND here we discuss about the OSCAT NETWORK (much more complcated)

Mg
#2
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 19. September 2025, 12:01:47
Not sure if we should keep discussing this here, or move to a Codesys specific place, like Codesys Forge. The latter has the advantage that we can share code there. Switching to english can be cumbersome for some. On the other hand it has a larger active user base.

Thoughts are welcome.
#3
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 19. September 2025, 12:00:35
In the mean time I have adapted the POUs _BUFFER_CLEAR() and _BUFFER_INIT() from OSCAT BASIC to compile on both 32bit as well as 64bit while retaining the original optimizations, which are quite smart indeed. Independent review and tests would be welcome (unit testing, for instance through co♻e ?).
#4
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 19. September 2025, 12:00:00
Thanks for getting back to me. Another forum member has contacted me through PM.
I do read German. Writing would be difficult and time consuming.

I am not asking Peewit, Hugo or other Oscat staff to do all the work for us. I would happily contribute and work together on this with other people. Like you I work in a small company and don't have time to do all the work myself either. Ideally I'd like to see a small group of people each doing some work, working together on reviewing and testing the results.

Also, last but not least, it would be invaluable to have peers to discuss options. For instance, I have done some work on the NETWORK library, more specifically the parts for logging to file as that is what I currently use a lot. The original code uses SysFile23. File open modes and error handling is done through bespoke STRING(2) and BYTE codes. As in, these codes are specific to the OSCAT libraries.

When converting to the current SysFile library rather than SysFile23, my initial approach has been to replace all bespoke OSCAT codes with types from SysFile. The file handle becomes a variable of type SysFile.RTS_IEC_HANDLE rather than a DWORD from original OSCAT code. The open_mode, originaly STRING(2), is now of type SysFile.ACCES_MODE. For error handling, the error_code was a BYTE with bespoke values typical to OSCAT. I changed that into SysFile.RTS_IEC_RESULT.

All of that works fine. However, it requires changes in the type FILE_SERVER_DATA. Which in turn requires code changes in all functions/function blocks that use FILE_SERVER_DATA. The original intention of the OSCAT programmers has been to have all the platform specific code inside FILE_SERVER so all other code can remain identical for all platforms. I now realise that my approach breaks this independency. It would make the CoDeSys branch incompatible with the other branches of the NETWORK library. It would be invaluable to have some other people think with me on issues like this.
#5
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von mg - 19. September 2025, 07:24:10
... about technical issues ...

You are right. The old libs with *23 on the end are the biggest problem. I use the BASIC in SIEMENS S7 too and I adapted it in the same way like you plan to do (dirty, but my parts I use work perfect for me).
For codesys I use the official one. There the big problem is for sure the NETWORK lib. 
I am working in a super small company too and I have no time to make real good engineered corrections on the lib. I can just report some bugs when I find one.

Regards

Mg
#6
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von mg - 19. September 2025, 07:09:42
Hello Anton

I am happy that at least you do some investigations about 64-bit OSCAT. I am very interested. I wrote it in other posts of the forum too.
I am a frequent user of this library and I am very interested about your news.
About OSCAT ...
a) First most users are germans (me too soso, at least I am a native german speaker). So for me it is unusual to discuss technical problems in english
b) The original inviters of OSCAT they are maybe a little bit older (maybe retiered, I do not know, I hope I do not blame some ones). At least 5 years ago this library had a very active communitiy now it is a blame. But the lib is still good and I use it NEARLY ALL DAY.
c) In this moment I check the forum all 3 months around.
d) It is not possible to send some codes with OSCAT-forum. The attachments have been disabled (due to too much SPAM from ... -- NO NAMES. I understand that, but it has ruined the forum).

Mg

PS: I hope Peewit or Hugo is still interested to do this work maybe somewhen.
#7
Modulentwicklung / Aw: Umstieg von Codesys 2.3 au...
Letzter Beitrag von AntonZan - 11. September 2025, 12:49:22
mg, I apologise for replying in English rather than German (and a bit late as well).

As of now there is no port to 64-bit controllers for the Oscat libraries that I know of. Most of the OSCAT_BASIC library will work on both 32-bit as well as 64-bit controllers. Only the _BUFFER_CLEAR() and _BUFFER_INIT() functions are very specifically optimised for 32-bit alignment of bytes and will not work correctly on 64-bit.

You are correct in pointing out that the OSCAT_NETWORK library for CoDeSys uses SysFile23 and SysSocket23 which are both only available for 32-bit. System libraries SysFile and SysSocket indeed have similar functionality and work on both 32-bit (PFC200) as well as 64bit (PFC300) controllers. In addition they would require CmpErrors for standard enumerated error codes rather than the Oscat specific error codes of the existing network library. While there are similarities between SysFile23/SysSocket23 and SysFile/SysSocket, the differences are sufficient to require many small changes as well as some decent testing to verify correctness.

The function blocks FILE_SERVER(), IP_CONTROL() and IP_CONTROL2() need significant modifications for porting to the use of the other libraries. Other parts of the code may require additional modifications. I have found this to be the case for the D_LOG_STORE_FILE_xxxx function blocks for logging to files. Limited resources have stopped me doing further work  on this.
#8
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 11. September 2025, 12:22:31
It has been a month since I started this thread. There have been over 300 views yet no replies. At first I thought summer holidays leads to delays in people responding to my questions in this thread. Summer holidays on the northern hemisphere are over though and still no response. And the views may have been mostly bots rather than humans.

This leads me to believe there is no interest in porting any of the Oscat codebase to 64-bit CoDeSys. I believe this can be done in a way that keeps the codebase working as before on 32-bit systems. As pointed out above, CoDeSys v3 has types like __XWORD as well as libraries SysFile and SysSocket rather than SysFile23 and SysSocket23 which would make this feasible.

For now I will keep using those portions of the libraries that port without modifications. I may adapt _BUFFER_CLEAR() and _BUFFER_INIT() from the Oscat BASIC lib for my own use. For now I have stopped using those. I have adapted a few parts of the Network library that are relevant for me so I can keep using the DLOG eco system for logging to file (csv, xml, html).

I work in a small business and have neither the time nor resources available to adapt all of the libraries in a way that meets quality standards. I am sorry to say that in the long run I may abandon most of Oscat altogether.
#9
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 11. August 2025, 11:22:35
OSCAT_NETWORK
On CoDeSys the original implementation of network and file access depends, among other things, on two libraries SysSocket23 and SysFile23. Both of these exist only for 32-bit platforms. Their counterparts SysSocket and SysFile will work on both 32 bit and 64 bit. They have similar functionality but types used and interfaces to the relevant POUs are not identical. Substantial changes seem required for POUs IP_CONTROL(), IP_CONTROL2() and FILE_SERVER().

So far we do not make extensive use of specific networking POUs. Everything that uses IP_CONTROL() and IP_CONTROL2() is for now commented out in my copy of OSCAT_NETWORK. We do use the DLOG POUs and types. So I have adapted the FILE_SERVER() function block to use SysFile rather than SysFile23. It is no rocket science, but not trivial either. So far it works for me, but lack of time may have resulted in me missing some points and taking some shortcuts. I have made extensive use of the __XWORD type. This allows for code that will run on both 32-bit and 64-bit platforms. File handles and error handling have needed some changes. It is not ideal, it does work.

As we do most logging to the file system, I did convert the POUs for that (mostly DLOG_STORE_FILE_CSV). Parts of the DLOG ecosystem that log via a network connection of the controllers would require IP_CONTROL() and IP_CONTROL2() to be reworked. I don't have time for that. For now I have excluded those parts from build in my copy of the OSCAT_NETWORK library.
#10
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 11. August 2025, 11:12:24
OSCAT_BASIC
Mostly works fine on either 32bit or 64bit controllers. However, the POUs _BUFFER_CLEAR() and _BUFFER_INIT() have their code very specifically optimized for 32-bit alignment. They would need to be either simplified or completely rewritten to run on 64-bit controllers. Even then, I would very much prefer to have a version that can be used without modifications on both 32-bit and 64-bit targets. I'm thinking use of some combination of pragma's, SIZEOF(), types like __XWORD and __XINT.

I currently don't have time to rewrite myself, so as a workaround I have made a copy of the BASIC library where I excluded _BUFFER_CLEAR() and _BUFFER_INIT(). I actually used these in one or two places. For now I have gone back to the use of simple FOR loops instead. It works fine, although I have lost the optimizations of the original OSCAT POUs.