B&R – PLC – Structured Text – AsString – itoa()

AsString – itoa()

Converts a DINT value into a character string

 

Call syntax (Automation Basic)

length = itoa(value,adr(Str))

 

Parameters

I/OParameterData typeDescription
IN valueDINTNumerical value to be converted into a string
IN pStringUDINT (given as a pointer to STRING)Address of destination character string
OUT lengthUINTLength of character string produced

Code example (Init-Sp)

(* init program *)

int_value := 100; (*initialize write – value*)

int_len := itoa(int_value, ADR(str));    (*write int_value to the string*)

 

Variable declaration

NameData typeScope
int_lenUINTLocal
int_valueDINTLocal
strSTRING[4]Local