AsString – ftoa()
Converts a REAL value into a character string
Call syntax (Automation Basic)
z = atof(adr(Str))
Parameters
I/O | Parameter | Data type | Description |
---|---|---|---|
IN | value | REAL | REAL (FLOAT) value to be converted into a character 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 *)
float_value := 10.0; (*initialize write – value*)
float_len := ftoa(float_value,ADR(str)); (*write float value to the string*)
Variable declaration
Name | Data type | Scope |
---|---|---|
float_len | UINT | Local |
float_value | REAL | Local |
str | STRING[4] | Local |