Panasonic FP Series Programming Manual page 219

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Conversion instructions
INT_TO_STRING
The function INT_TO_STRING converts a value of the data type INT to a value of the data type
Description
STRING.
Generates a result string in right-aligned decimal representation, filled with leading spaces up to
the predefined maximum number of characters.
Explanation
Function used
String1:=INT_TO_STRING(-12345)
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
PLC types Availability of INT_TO_STRING (see page 1327)
 When using the data type STRING with small PLCs like FP-e or FP0,
make sure that the length of the result string is equal to or greater than
the length of the source string.
 For further information refer to the online help: Upgrade Problems with
Data Type STRING
Data types
Data type
INT
STRING
In this example, the same POU header is used for all programming languages. For an example
Example 1
using IL (instruction list), please refer to the online help.
POU header
In the POU header, input and output variables are declared that are used in the function.
The input variable INT_value of the data type INT is intialized by the value -12345. The output
variable result_string is of the data type STRING[8]. It can store a maximum of 8 characters.
Instead of using the variable INT_value, you can enter a constant directly at the function's input
contact in the body.
218
INTEGER into STRING
String1
defined as
STRING[1]
STRING[2]
STRING[3]
STRING[4]
STRING[5]
STRING[6]
STRING[7]
STRING[8]
and so on...
I/O
Function
input
input data type
output
conversion result
Result
'5'
'45'
'345'
'2345'
'12345'
'-12345'
' -12345'
'
-12345'

Advertisement

Table of Contents
loading

Table of Contents