Neueste Beiträge

#1
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.
#2
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.
#3
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.
#4
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.
#5
oscat.lib fuer CoDeSys 3 / Aw: Oscat and 64-bit controlle...
Letzter Beitrag von AntonZan - 11. August 2025, 11:10:54
I have done some work on a few things that are most urgent for me. However I lack time and resources to do everything and have it properly reviewed and tested by others. What I have found and what I have done so far can be useful additional background information.
#6
oscat.lib fuer CoDeSys 3 / Oscat and 64-bit controllers
Letzter Beitrag von AntonZan - 11. August 2025, 11:08:39
I have been using the Oscat libraries BASIC and NETWORK for several years now and have always been happy with the added functionality. Recently, we have started looking into 64-bit controllers at work, programmed through CoDeSys 3.5 with 64-bit targets. Here is where I run into some issues. It seems more people have asked about this every once in a while. So far I find no consensus on how things with Oscat will progress in that direction.

My question is: will any work be done about supporting 64-bit targets for the OSCAT libraries? Either by the good people of the original Oscat libs here, or some small group of volunteers? If so, how are we to move forward on this?
#7
Modulentwicklung / Aw: Umstieg von Codesys 2.3 au...
Letzter Beitrag von mg - 07. August 2025, 17:16:24
... die "Portierung" ... betrifft das nun die 64bit Version.
Ich kann nichts finden.
#8
Codesys 2 / EATON XV100 und MQTT
Letzter Beitrag von Florian - 03. August 2025, 19:47:58
Moin Zusammen,

ich verzweifel langsam...
Ich habe vor vielen Jahren die Reste einer Versuchsanordnung meines damaligen Arbeitgebers übernehmen können. Es war eine SoftSPS (XV100, damals noch von Microinnovation, später Möller und dann EATON) mit vielen I/O-Modulen die über CAN-Bus mit der SPS kommunizieren. Auf der SoftSPS läuft WindowsCE und ich habe sie über CodeSys 2.3 in ST programmiert.
Ich steckte damals in der Kernsanierung meines Wohnhauses und habe die SPS kurzerhand ins Haus integriert (Licht-, Tor-, Belüftungssteuerung etc.)...

Seit einigen Jahren betreibe ich parallel openHAB und habe viele Geräte über MQTT mit openHAB verheiratet.
openHAB und die XV100 habe immer - mehr schlecht als recht - über MODBUS-TCP kommuniziert.
Nun habe ich aber auch noch einen PV-Wechselrichter im Haus und damit ein weiteres MOD-BUS-System und nun ist ganz vorbei.
Ein Befehl aus openHAB wird von der SPS teilweise erst nach 4-5 Stunden ausgeführt. Für ein Garagentor echt unpraktisch.

Ich möchte auf meiner SPS gerne einen MQTT-CLient einrichten der die Daten zukünftig schnell mit openHAB austauscht.
Auf openHAB (PaspberryPi 5) läuft ein und MQTT-Server der mit vielen Geräten einwandfrei und extrem schnell kommuniziert.

Bei meiner Suche habe ich zwei MQTT.lib im Netz gefunden.
Die eine Bibliothek erfordert die oscat_basic_333.lib und die WagoLibEthernet_01.lib wodurch die maximale Anzahl an Bausteinen weit über 1024 geht und das Kompilieren mit eben diesem Fehler abbricht.
Nach der erhöhen der Begrenzung kann ich zwar kompilieren und das Programm auf die SPS übertragen aber die MQTT-Verbindung rührt sich kein Stück...

Die andere Bibliothek benötigt neben den schon implementierten Bibliotheken keine weiteren.

Bei der zweite Lib werden immer folgende Fehler gemeldet:
'TCP Server Connection Timeout'
'Connecting to TCP Server failed'
'TCP Socket created'

Hat irgendjemand eine funktionierende Lib für CodeSys 2.3?
Hat jemand ein paar Beispiele?
Die nächste zu nehmende Hürde wird JSON sein, auch da würde ich mich über hilfreiche Tipps freuen.

Vielleicht gibt es ja einen passenden Baustein.

Danke und Gruß
Florian

...Ach so, eine Firewall läuft auf WindowsCE nicht und alle Ports sind offen!
#9
Codesys 2 / Aw: Zugriff von zwei MB_Client...
Letzter Beitrag von TroniGord - 03. Juli 2025, 15:52:29
Hallo,
ich habe das Problem gelöst.
Hier die Info an alle, die dasselbe Problem haben.
Die Bausteine mussten durch einen Neustart des Betriebssystems mit hochlaufen!
Dann hat alles funktioniert!

#10
Codesys 2 / Zugriff von zwei MB_Clienten a...
Letzter Beitrag von TroniGord - 01. Juli 2025, 15:16:54
Hallo,
ich möchte mit zwei MB_Clienten auf einen MB_Server zugreifen.
Im Programm (Codesys 3.5) habe ich zwei Server_Programme angelegt.
Je Server_Programm habe ich ein IP_Control_2 und ein MB_SERVER angelegt.
Da immer nur ein IP_Control_2 und ein MB_SERVER pro Client funktioniert.
Beim ersten Server_Programm nutze ich Port 502 und beim zweiten Server_Programm nutze ich Port 503.
Die IP-Adresse Localhost 127.0.0.1 habe ich bei beiden hinterlegt, da ich nur eine Schnittstelle habe.

Beide Server_Programme funktionieren einzeln perfekt und auch ohne Problem.
Nur wenn ich beide gleichzeitig nutzen möchte (also Zugriff mit zwei Clienten auf je einen Server)
funktioniert nur der, der als letztes vom Zyklus aufgerufen wurde.

Hat vieleich jemand eine Idee?
Für etwas Hilfe wäre ich dankbar!