Conversion instructions
695
Part III FP Instructions
F335_FSIGN
Floating point data sign changes (negative/positive conversion)
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 F335_FSIGN (see page 1324)
Variable Data type Function
s REAL source
d REAL destination
For Relay T/C Register Constant
s DWX DWY DWR DWL DSV DEV DDT DLD DFL dec. or hex.
d - DWY DWR DWL DSV DEV DDT DLD DFL -
No. IEC address Set If
R9007 %MX0.900.7 permanently
R9008 %MX0.900.8 for an instant
the value at input s is not a REAL
number.
R9009 %MX0.900.9 for an instant the result causes an overflow.
In this example, the input variable input_value is declared. However, you can write a constant
directly at the input contact of the function instead.
Description
The function changes the sign of the floating point value at input s and returns the result at output
d.
Data types
Operands
Error flags
Example
In this example, the same POU header is used for all programming languages. For an 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.
Body
The value 333.4 is assigned to the variable input_value. When the variable start is set to TRUE,
the function is carried out. The output_value is then -333.4.