Posted 3 Nov 2020 Hello. I'm having difficulties of how to write REAL constant in ST. For example (Gap1 is defined as REAL): Gap1:= UDINT_TO_REAL(P_Cycle_Time_Value) / +1000.0; RETURNS ERROR ERROR: Conversion cannot convert from Integer Literal to REAL I have also tried 1000.0 If I use: Gap1:= UDINT_TO_REAL(P_Cycle_Time_Value) / INT_TO_REAL(1000); COMPILES OK My question.. How do I write REAL constant in Structure text? I don't want to use INT_TO_REAL anytime I want to do calculations with constants.. Thanks. BR. Share this post Link to post Share on other sites
Posted 3 Nov 2020 I guess it has something to do with Regional Format (SL). I have to use comma (1000,0) instead of dot (1000.0).... In other software which uses structure text, I didn't have this kind of problem... BR. 1 person likes this Share this post Link to post Share on other sites