Panasonic FP Series Programming Manual page 233

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Conversion instructions
This example shows how, from an input value of the data type TIME, a TIME STRING[9] with the
Example 2
format 'xxhxxmxxs' is created (only hours, minutes and seconds are output).
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 TIME and an output variable
result_string of the data type STRING[9] are declared.
In carrying out the operation in question, the standard function MID is attached to the function
Body
TIME_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 9 is entered at the L input of MID, which determines the length of
the result string. The INT constant 7 at input P determines the position at which the central sector
begins. Out of the variable input_value = T#1h30m45s, the STRING 'T#000d01h30m45s000ms'
results from the data type conversion. The MID function cuts off the STRING at position 7 and
yields the result_string '01h30m45s'.
LD
232

Advertisement

Table of Contents
loading

Table of Contents