3. Instructions
510
CS/CJ/NSJ Series Instructions Reference Manual (W474)
FVAL
Applicable Program Areas
Operands
z Operand Specifications
Flags
Function
FVAL(449) converts the specified ASCII text number (starting at word S) to a 32-bit floating-point
number (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
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK 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/EM
addresses
Con-
stants
Registers
TK CF
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
S
OK OK OK OK OK OK OK OK OK OK --- --- --- OK --- --- --- ---
D
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 +o or -o 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