2-249
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Floating-point Math
Instructions
2
FVAL
FVAL
Applicable Program Areas
Operands
Operand Specifications
Flags
Function
FVAL(449) converts the specified ASCII text number (starting at word S) to a 32-bit floating-point num-
ber (IEEE754-format) and outputs the result to the destination words starting at D.
FVAL(449) can convert ASCII text in decimal or scientific notation if it meets the following conditions:
Up to 6 characters are valid, excluding the sign, decimal point, and exponent. Any characters beyond
the 6th character will be ignored.
• Decimal Notation
Real numbers expressed with an integer and fractional part.
Example: 124.56
Instruction Mnemonic Variations
Function
code
Function
ASCII TO FLOATING-POINT FVAL @FVAL 449
Converts a number expressed in ASCII text (deci-
mal or scientific notation) to a 32-bit floating-point
value (IEEE754-format) and outputs the floating-
point value to the specified words.
Symbol
FVAL
Area Step program areas Subroutines Interrupt tasks
Usage OK OK OK
Operand Description Data type Size
S First source word UINT Variable
D First destination word REAL 2
Area
Word addresses Indirect DM addresses
Constants CF
Pulse
bits
TR
bits
CIO WR HR AR T C DM @DM *DM
S, D OKOKOKOKOKOKOK OK OK --- --- --- ---
Name Label Operation
Error Flag P_ER • ON if the digits (integer and fractional parts) in the source data starting at S are not 30 to 39 hex (0 to
9).
• ON if the first two digits of the exponential part do not contain 45 and 2B hex (E+) or 45 and 2D hex
(E-). in the source data starting at S are not 30 to 39 hex (0 to 9).
• ON if there are two or more exponential parts in the source data.
• ON if the data is +∞ or -∞ after conversion.
• ON if there are 0 characters in the text data.
• ON if a byte containing 00 hex is not found within the first 25 characters.
• OFF in all other cases.
Equals Flag P_EQ • ON if the conversion result is 0.
• OFF in all other cases.
S: First source word
D: First destination word
FVAL(449)
S
D