VARIANT / ANY in AX

0
Hi Community!In TIA Portal, I have made a standard FB to send data over UDP. It uses a VARIANT pointer to serialize any UDT I throw at it. I noticed that AX does not have such a VARIANT pointer, and the System.Serialization.Serialize function only takes elementary datatypes, not structured types. Can anyone help me with the approach in AX? I would really like to have a class or FB that can send arbitrary structured types over UDP. Thanks a bunch!Cheers, Nathan
asked
2 answers
0

You can use the built-in Source Actions for generating serializing and deserializing functions for your costum structured types (https://docs.industrial-operations-x.siemens.cloud/r/en-us/ax-vscode/siemens.st-lang/3.5.58/structured-text-language-extension/source-actions/generating-serialization-functions).

This deals with the limitation that the system function only takes in elementary data types.

answered
0

Thanks for your answer!


I know about the generation of these serialization functions, but I was wondering if a TIA-like serialize function that can take a VARIANT dt will ever come to AX.


The generator, for example, serializes BOOL datatypes to their own BYTE instead of packing multiple into a WORD or BYTE.

answered