Panasonic FP Series Programming Manual page 245

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Conversion instructions
INT_TO_BCD_WORD
INT_TO_BCD_WORD converts a binary value of the data type INT into a binary coded decimal
Description
integer (BCD) value of the type WORD in order to be able to output BCD values in word format.
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.
Availability of INT_TO_BCD_WORD (see page 1327)
PLC types
Since the output variable is of the type WORD and is therefore comprised of 16
bits, the value for the input variable is limited to 4 digits and must be between 0
and 9999.
Data types
Data type
INT
BCD_WORD
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
This example uses variables. You can also use a constant for the input variable.
Body
INT_value of the data type INTEGER is converted into a BCD value of the data type WORD. The
converted value is written into BCD_value_16bit.
LD
ST
When programming with structured text, enter the following:
BCD_value_16bit:=INT_TO_BCD_WORD(INT_value);
244
INTEGER into BCD value of WORD
I/O
Function
Input
input data type
Output
conversion result

Advertisement

Table of Contents
loading

Table of Contents