Twincat3 ST variables conversion

579 views Asked by At

I have some complicated array of structures and I want to write it into CSV file. So I need "variable to string" conversion. Beckhoff as always doesn't care about documentation and their INT_TO_STRING function doesn't work (UNEXPECTED INT_TO_STRING TOKEN when I try to write INT_TO_STRING(20) ). Moreover their string functions works correctly with only 255 chars.

So I need one of following:

  • working functions or function blocks or library which allows to convert different types to string
  • something like sprintf without limitations
  • some functions to convert between number and ascii char (0x55 is letter 'U') in both directions.

btw. Beckhoff gives us some weird CSV example code, but without data conversion (array has already strings in cells).

Thanks in advance!

I tried to use: INT_TO_STRING() BYTE_TO_STRING() WHATEVER_TO_STRING()

but it is not working. And there is no clue how many arguments it should have or anything. There is no documentation in Beckhoff information System.

0

There are 0 answers