AsString – itoa()
Converts a DINT value into a character string
Call syntax (Automation Basic)
length = itoa(value,adr(Str))
Parameters
I/O | Parameter | Data type | Description |
---|---|---|---|
IN | value | DINT | Numerical value to be converted into a string |
IN | pString | UDINT (given as a pointer to STRING) | Address of destination character string |
OUT | length | UINT | Length 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
Name | Data type | Scope |
---|---|---|
int_len | UINT | Local |
int_value | DINT | Local |
str | STRING[4] | Local |