Roald
Roald

Reputation: 2979

Failed to read and write xml file with TwinCAT

I have a custom function block which can read or write xml files. It can also create a new file, if one with the current name already exists. It does that by appending a number to the filename.

The first xml file is created without a problem (e.g. 1_Filename.xml). However, if i run the code a second time when it should create 2_Filename.xml, it gives me error 1828: Incompatible version of the serializing package.

Also when I try to load 1_Filename.xml, it gives me error code 1828.

Finally if I change the "base" filename from Filename to AnotherFilename, it creates 1_AnotherFilename without a problem, but fails when trying to create 2_Filename. Again with the same error code.

Upvotes: 0

Views: 793

Answers (1)

Roald
Roald

Reputation: 2979

Turns out I was looking at the wrong error codes. It was not a Win32 error code, but an ADS return code. For some strange reason these two error codes have overlapping numbers!

ADS error code 1828 means Missing license. Turns out the Tc3 XML-Server license did not get added automatically to my project. I had to manually add and create a trail license for it. Afterwards everything worked.

Upvotes: 0

Related Questions