Conversion instructions
655
Part III FP Instructions
F89_EXT
16-bit data sign extension, INT -> DINT
If the sign bit (bit position 15) of the 16-bit data specified by s is 0, all higher 16 bits in the variable
assigned to d will be 0. If the sign bit of s is 1, the higher 16 bits of d will be 1.
·········
31 2827 2423 2019 16
·········
15
1
1211
11
8
1
7
11
4
1
3
10
0
·········
15
1
1211
11
8
1
7
11
4
1
3
10
0
s
111 1 1 11
–2
111 1 1 111 11 11 111111 1 1 111
–2
d
Source
Destination
Bit position
Bit position
Binary data
Binary data
Decimal data
Decimal data
Sign bit (0: positive, 1: negative)
Higher (extended) 16-bit area
Lower 16-bit area
start: ON
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
PLC types
Availability of F89_EXT (see page 1326)
Variable Data type Function
s ANY16 16-bit source data area, bit 15 is sign bit
d ANY32 32-bit destination area, s copied to lower 16 bits, higher 16
bits filled with sign bit of s
For Relay T/C Register Constant
s - WY WR WL SV EV DT LD FL -
d - DWY DWR DWL DSV DEV DDT DLD DFL -
Description
16-bit data is converted to 32-bit data without signs and values being changed. F89 copies the sign
bit of the 16-bit data specified in s to all the bits of the higher 16-bit area (extended 16-bit area) in
d.
Data types
Operands
Example
In this example the function has been programmed in ladder diagram (LD) and structured text
(ST).The same POU header is used for all programming languages.
POU header
All input and output variables used for programming this function have been declared in the POU
header.