REAL / LREAL to String with Scientific Notation Structured Text

720 views Asked by At

I am looking for a way to convert a floating-point value to scientific notaiton string in Beckhoff TwinCAT or codesys. The documentation for their FB_FormatString says this is not currently supported. Does anyone have a "goto" approach for this?

1

There are 1 answers

0
Peter Zerlauth On BEST ANSWER

In TwinCAT I use LREAL_TO_FMTSTR

sOut := LREAL_TO_FMTSTR( 0.46523, 2, TRUE );