Panasonic FP Series Programming Manual page 231

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Conversion instructions
This example illustrates how you create a STRING[7] with 4 positions before and 2 positions after
Example 2
the decimal point out of the data type REAL.
The example is programmed in LD and IL. The same POU header is used for both programming
languages.
POU header
In this example, both an input variable input_value of the data type REAL and an output variable
result_string of the data type STRING[7] are declared.
In carrying out the operation in question, the standard function MID is attached to the function
Body
REAL_TO_STRING. MID creates a central sector in the character string from position P (INT
value) with L (INT value) characters.
In the example, the INT constant 7 is entered at the L input of MID, which determines the length of
the result string. The INT constant 4 at input P determines the position at which the central sector
begins. Out of the variable input_value = -123.4560166, the STRING '
from the data type conversion. The MID function cuts off the STRING at position 4 and yields the
result_string '-123.45'.
LD
230
-123.4560166' results

Advertisement

Table of Contents
loading

Table of Contents