430
7 APPLICATION INSTRUCTION
7.7 Real Number Instruction
Converting character string to single-precision real number
EVAL(P)/DEVAL(P)
These instructions convert the character strings in the device areas specified by (s) and later to single-precision real number,
and store the converted data in the device specified by (d).
The EVAL(P) instructions can also be used as DEVAL(P).
■Descriptions, ranges, and data types
■Applicable devices
*1 T, ST, C cannot be used.
• These instructions convert the character strings in the device areas specified by (s) and later to single-precision real
number, and store the converted data in the device specified by (d).
• A specified character string may be in the decimal point format or exponent format. A character string in either format can
be converted into single-precision real number.
• A character string can consist of up to 24 characters. 20H (space) and 30H (0) in a character string are counted as one
character each.
■Decimal point format
• When the character string specified by (s) is decimal point format, the operation is executed as follows.
Ladder diagram Structured text
ENO:=EVAL(EN,s,d);
ENO:=EVALP(EN,s,d);
Operand Description Range Data type Data type (label)
(s) Character string data to be converted to single-precision
real number or head device number where the character
string data is stored
Character string Character string
(d) Head device number storing converted single-precision real
number
Single-precision real number Single-precision real number
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s)
*1
(d)
(s)
(s)+1
(s)+2
(s)+3
(s)+4
b15 b0
b7b8
00H
(d)(d)+1
ASCII code for 1st character
ASCII code for 3rd character
ASCII code for 5th character
ASCII code for sign
ASCII code for 2nd character
ASCII code for 4th character
ASCII code for 7th character
ASCII code for 6th character
Indicates the end of the character string.
Single-precision real number
(s)
(s)+1
(s)+2
(s)+3
(s)+4
b15 b0
b7b8
00H
(d)(d)+1
31H (1)
30H (0)
38H (8)
2DH (-)
2EH (.)
37H (7)
32H (2) 31H (1)
0
7
8
1 2.1-
71-.08 12
Single-precision real number