Mir ist nicht bekannt, dass CODESYS CAN FD in nächster Zeit für Prozessdaten anbieten will. Müsste ein CDS Supporter beantworten. Aber ab SP22 ist es zumindest für die Service-Verbindung verfügbar (Download/Debugging...). Soviel weiß ich.
Using a UNION instead of a STRUCT alone should give you that flexibility and only occupy memory once. And if you want to be really elegant, you could use an FB, which only holds PUBLIC VAR. Because a POU can use "EXTENDS"/inheritance. In CODESYS V3, an FB has a lot in common with C++ classes. Using ANY or ALIAS is rarely a good idea. It neither won't be pretty, nor have good readability and requires you to create a lot of error-prone things around it.
--- deleted. Was a bug.
--- deleted. Was a bug.
--- deleted. Was a bug.
--- deleted. Was a bug.
--- deleted. Was a bug.
Using a UNION instead of a STRUCT alone should give you that flexibility and only occupy memory once. And if you want to be really elegant, you could use an FB, which only holds PUBLIC VAR. Because a POU can use "EXTENDS"/inheritance. In CODESYS V3, an FB has a lot in common with C++ classes. Using ANY or ALIAS is rarely a good idea. It neither won't be pretty, nor have good readability and requires you to create a lot of error-prone things around it.