Panasonic FP Series Programming Manual page 220

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Body
The INT_value of the data type INT is converted into STRING[8]. The converted value is written to
result_string. When the variable INT_value = -12345, result_string shows '
LD
ST
When programming with structured text, enter the following:
result_string:= INT_TO_STRING(input_value);
This example illustrates how you create a STRING[2] that appears right justified out of the data
Example 2
type INT.
POU header
In this example, both an input variable INT_value of the data type INT and an output variable
result_string of the data type STRING[2] are declared.
In carrying out the operation in question, the standard function RIGHT (see page 265) is attached
Body
to the function INT_TO_STRING. RIGHT creates a right-justified character string with the length L.
In the example, the variable INT_variable = 12 is converted by INT_TO_STRING to the dummy
string '
12'. The function RIGHT then creates the result_string '12'.
LD
When programming with structured text, enter the following:
ST
result_string:=RIGHT(IN:=INT_TO_STRING(input_value), L:=2);
Conversion instructions
-12345'.
219

Advertisement

Table of Contents
loading

Table of Contents